feat(админка): действия в карточке и тост отмены

This commit is contained in:
anor
2026-11-06 22:01:23 +10:00
parent e15369c4d4
commit 0e9a95e95b
9 changed files with 166 additions and 9 deletions
+2
View File
@@ -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)