summaryrefslogtreecommitdiffstats
path: root/core/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/utils.py')
-rw-r--r--core/utils.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/utils.py b/core/utils.py
index 33872b3..d88f39f 100644
--- a/core/utils.py
+++ b/core/utils.py
@@ -157,6 +157,25 @@ def current_expo():
else:
return settings.EPOCH.year # this is 1970
+def is_identified_user(user):
+ if user.is_anonymous:
+ return False
+ if user.username in ["expo", "expoadmin"]:
+ return False
+ return True
+
+def get_git_string(user):
+ if not is_identified_user(user):
+ return None
+ else:
+ people = Person.objects.filter(user=user)
+ if len(people) != 1:
+ # someone like "fluffy-bunny" not associated with a Person
+ return None
+ person = people[0]
+ return f"{person.fullname} <{user.email}>"
+
+
def parse_aliases(aliasfile):
"""Reads a long text string containing pairs of strings:
(alias, target)