fix: allow disabling main key

This commit is contained in:
Андрей Бобырев
2026-06-07 01:25:03 +03:00
parent caee0b4cff
commit dfa2703e61
3 changed files with 4 additions and 7 deletions

View File

@@ -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):