From dfa2703e6143141a4071dccc4e8a1c2e4f924caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Sun, 7 Jun 2026 01:25:03 +0300 Subject: [PATCH] fix: allow disabling main key --- admin-web/server.py | 3 --- admin-web/static/app.js | 4 ++-- admin-web/static/index.html | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/admin-web/server.py b/admin-web/server.py index a580b47..8407fce 100644 --- a/admin-web/server.py +++ b/admin-web/server.py @@ -2285,9 +2285,6 @@ class AdminHandler(BaseHTTPRequestHandler): ), "restart": {"mode": "async", "requested": restart_requested}}) elif path.startswith("/api/users/") and path.endswith("/enabled"): name = urllib.parse.unquote(path[len("/api/users/"):-len("/enabled")]) - if name == "main": - self.send_error_json(400, "main user cannot be disabled") - return enabled = bool(body.get("enabled")) try: with FileLock(USER_LOCK_FILE): diff --git a/admin-web/static/app.js b/admin-web/static/app.js index 48ca8df..23a6791 100644 --- a/admin-web/static/app.js +++ b/admin-web/static/app.js @@ -1302,8 +1302,8 @@ function renderUsers() { ${escapeHtml(user.name)}${user.main ? ` ${escapeHtml(t("main"))}` : ""}
-
- +