mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
fix(auth): validate reset passwords and make the last-admin guard atomic, with tests (#5106)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user