diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2025-05-22 14:40:08 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2025-05-22 14:40:08 +0300 |
commit | 955baeb238c52777ced6006b3a925e9f06dfd98a (patch) | |
tree | f8e57eee6a729add7a175b9f350b7422fb2a18d0 /core/utils.py | |
parent | 9ae9ca9ec39b20f6c680308e5171191cfb83c185 (diff) | |
download | troggle-955baeb238c52777ced6006b3a925e9f06dfd98a.tar.gz troggle-955baeb238c52777ced6006b3a925e9f06dfd98a.tar.bz2 troggle-955baeb238c52777ced6006b3a925e9f06dfd98a.zip |
only allows registration once, except for admins
Diffstat (limited to 'core/utils.py')
-rw-r--r-- | core/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/utils.py b/core/utils.py index 3db7d04..d86b901 100644 --- a/core/utils.py +++ b/core/utils.py @@ -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): |