fix(auth): validate reset passwords and make the last-admin guard atomic, with tests (#5106)

This commit is contained in:
Sam Dornan
2026-10-04 10:18:15 -04:00
committed by GitHub
parent 8a243c71e9
commit 3204037797
9 changed files with 860 additions and 29 deletions

View File

@@ -7,3 +7,12 @@ class RomFileOwnerChangedError(Exception):
def __repr__(self) -> str:
return self.message
class LastAdminError(Exception):
def __init__(self, user_id: int) -> None:
self.message = f"User {user_id} is the last admin"
super().__init__(self.message)
def __repr__(self) -> str:
return self.message