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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user