Commit c219a9a
authored
fix: use system context for querying workspaces when deleting users (coder#19211) (coder#19227)
Backport of coder#19211 to our ESR, v2.24, since this is a kind of bad
(albeit rare) bug and very easy to fix.
### Original PR
Closes coder#19209.
In `templates.go`, we do this to make sure we count ALL workspaces for a
template before we try and delete that template:
https://github.com/coder/coder/blob/dc598856e3be0926573dbbe2ec680e95a139093a/coderd/templates.go#L81-L99
However, we weren't doing the same when attempting to delete users,
leading to the linked issue. We can solve the issue the same way as we
do for templates.1 parent 5ff7496 commit c219a9a
2 files changed
+41
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
545 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
546 | 549 | | |
547 | 550 | | |
548 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
381 | 418 | | |
382 | 419 | | |
383 | 420 | | |
| |||
0 commit comments