summaryrefslogtreecommitdiffstats
path: root/parsers
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-01-26 19:04:56 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-01-26 19:04:56 +0000
commitce508b0eb28551efbb9d7aaf18f1e76994e7c38b (patch)
tree7d9086dcc8b4d73959018d6f7ccd5e13b858c37a /parsers
parent7fab42fa9e4067fdd99eca81d736d37c50f27291 (diff)
downloadtroggle-ce508b0eb28551efbb9d7aaf18f1e76994e7c38b.tar.gz
troggle-ce508b0eb28551efbb9d7aaf18f1e76994e7c38b.tar.bz2
troggle-ce508b0eb28551efbb9d7aaf18f1e76994e7c38b.zip
Use logon not cookie when editing pages
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: