diff --git a/admin.py b/admin.py index 445cfaa..b72d615 100644 --- a/admin.py +++ b/admin.py @@ -126,11 +126,13 @@ def register_admin_routes(app): # Update user in Firestore user_ref = db.collection("users").document(target_uid) - user_ref.update({ + # Only update fields that can be changed, excluding is_admin + update_data = { "enabled": data.get("enabled", False), - "is_admin": data.get("is_admin", False), "case_email": data.get("case_email", "") - }) + } + # Never allow changing is_admin field during updates - admin status can only be set during creation + user_ref.update(update_data) return jsonify({"success": True}) diff --git a/templates/admin_user_edit.html b/templates/admin_user_edit.html index 6f74980..3a4ef16 100644 --- a/templates/admin_user_edit.html +++ b/templates/admin_user_edit.html @@ -26,11 +26,15 @@
Admin status can only be set during user creation.
+ {% endif %}If you don't have a user account, or need to reset your password, send an email to office@rothbardlawgroup.com.
+