feat(админка): действия в карточке и тост отмены
This commit is contained in:
@@ -70,6 +70,8 @@ def _apply(email: str, action: str, value: dict) -> None:
|
||||
def perform(actor: str, email: str, action: str, value: dict) -> dict:
|
||||
if action not in ACTIONS:
|
||||
raise ValueError("неизвестное действие")
|
||||
if action in ("role", "block") and actor.strip().lower() == email.strip().lower():
|
||||
raise ValueError("свою роль и блокировку менять нельзя")
|
||||
before = _before(email, action)
|
||||
_apply(email, action, value)
|
||||
after = _before(email, action)
|
||||
|
||||
Reference in New Issue
Block a user