2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-01-24 13:22:27 +00:00

made robust to unknown names

This commit is contained in:
2025-08-01 21:20:00 +02:00
parent 579389589b
commit 6123c03ef4
2 changed files with 9 additions and 2 deletions

View File

@@ -876,7 +876,10 @@ def walletedit(request, path=None):
else:
people = waldata["people"] # text string
for person in waldata["people"]:
person_id = who_is_this(year, person)
try:
person_id = who_is_this(year, person)
except:
continue
print(f"walletedit: {person}, {person_id}")
persons.append(Person.objects.get(slug=person_id))

View File

@@ -263,7 +263,11 @@ def ensure_users_are_persons():
def who_is_this(year, possibleid):
expo = Expedition.objects.filter(year=year)[0]
personexpedition = GetPersonExpeditionNameLookup(expo)[possibleid.lower()]
gpel = GetPersonExpeditionNameLookup(expo)
if possibleid.lower() in gpel:
personexpedition = gpel[possibleid.lower()]
else:
raise
if personexpedition:
return personexpedition.person
else: