summaryrefslogtreecommitdiffstats
path: root/parsers
diff options
context:
space:
mode:
Diffstat (limited to 'parsers')
-rw-r--r--parsers/users.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/parsers/users.py b/parsers/users.py
index 97d06a0..30b491b 100644
--- a/parsers/users.py
+++ b/parsers/users.py
@@ -22,11 +22,11 @@ Passwords are only ever stored as hashes using the standard Django functions.
todo = """
- Not fully tested, needs experience
-- Need to write to BierBook for signups
-
- Need to check/register with lists.wookware.org for email
"""
+SUPER_USERS = ["philip-sargent"] # list of userids who get the same rights as "expoadmin" i.e. the Django control panel
+
USERS_FILE = "users.json"
ENCRYPTED_DIR = "encrypted"
@@ -54,8 +54,13 @@ def register_user(u, email, password=None, pwhash=None, fullname=""):
# user.set_password(None) # use Django special setting for invalid password, but then FAILS to send password reset email
user.set_password("secret") # Why is the Django logic broken. Hmph.
print(f" # setting INVALID password for user {u}, must be reset by password_reset")
- user.is_staff = False
- user.is_superuser = False
+ if u in SUPER_USERS:
+ user.is_staff = True
+ user.is_superuser = True
+ print(f"** {u} is SUPER and can access everything on the Django control panel")
+ else:
+ user.is_staff = False
+ user.is_superuser = False
user.save()
print(f" - receated and reset user '{user}'")
except Exception as e: