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