2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-03-27 18:51:48 +00:00

only allows registration once, except for admins

This commit is contained in:
2025-05-22 14:40:08 +03:00
parent 9ae9ca9ec3
commit 955baeb238
6 changed files with 99 additions and 60 deletions

View File

@@ -277,6 +277,15 @@ def is_identified_user(user):
if user.username in ["expo", "expoadmin"]:
return False
return True
def is_admin_user(user):
if user.is_anonymous:
return False
if user.username in ["expoadmin"]:
return True
if user.is_superuser: # set in parsers/users.py i.e. WOokey, Philip S.
return True
return False
def get_git_string(user):
if not is_identified_user(user):