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

Use logon not cookie when editing pages

This commit is contained in:
2025-01-26 19:04:56 +00:00
parent 7fab42fa9e
commit ce508b0eb2
8 changed files with 67 additions and 206 deletions

View File

@@ -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)