GuardLastAdmin counted only active, non-deletion-scheduled admins, but gated only on target.IsAdmin. Demoting or deleting an already-disabled or deletion-scheduled admin would then be blocked whenever exactly one active admin remained, even though removing a user who isn't in the reachable set can't reduce the count. Return early when the target isn't part of the counted set. |
||
|---|---|---|
| .. | ||
| caldav_token.go | ||
| db.go | ||
| delete.go | ||
| error.go | ||
| events.go | ||
| is_admin_test.go | ||
| listeners.go | ||
| main_test.go | ||
| notifications.go | ||
| test.go | ||
| token.go | ||
| totp.go | ||
| totp_test.go | ||
| update_email.go | ||
| update_email_test.go | ||
| user.go | ||
| user_claims_test.go | ||
| user_create.go | ||
| user_email_confirm.go | ||
| user_email_confirm_test.go | ||
| user_password_reset.go | ||
| user_test.go | ||
| users_project.go | ||
| validator.go | ||