2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00

small chnages to name resolution

This commit is contained in:
Philip Sargent 2022-10-07 23:47:05 +03:00
parent c76cd38d76
commit f51d1e114e
3 changed files with 11 additions and 3 deletions

View File

@ -145,7 +145,7 @@ def walletslistperson(request, first_name, last_name):
if last_name:
p = Person.objects.get(fullname= f'{first_name} {last_name}')
else:
# speciall Wookey-hack
# special Wookey-hack
p = Person.objects.get(first_name= f'{first_name}')
except:
#raise

View File

@ -100,6 +100,8 @@ def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
tripperson = "Phil Wigglesworth"
if tripperson =="Animal":
tripperson = "Mike Richardson"
if tripperson =="MikeTA":
tripperson = "Mike Richardson"
personyear = GetPersonExpeditionNameLookup(expedition).get(tripperson.lower())

View File

@ -129,6 +129,11 @@ def load_people_expos():
# used in other referencing parser functions
# expedition name lookup cached for speed (it's a very big list)
# should have a LIST of nicknames, just populate the first entry from folk.csv
# Refactor. The dict GetPersonExpeditionNameLookup(expo) indexes by name and has values of personexpedition
# This is convoluted, the whole personexpedition concept is unnecessary.
Gpersonexpeditionnamelookup = { }
def GetPersonExpeditionNameLookup(expedition):
global Gpersonexpeditionnamelookup
@ -151,14 +156,15 @@ def GetPersonExpeditionNameLookup(expedition):
possnames.append(f + " " + l[0])
possnames.append(f + l[0])
possnames.append(f[0] + " " + l)
possnames.append(f[0] + l[0]) # initials e.g. gb or bl
possnames.append(f)
if full not in possnames:
possnames.append(full)
if personexpedition.nickname not in possnames:
possnames.append(personexpedition.nickname.lower())
if l:
# This allows for nickname to be used for short name eg Phil
# adding Phil Sargent to the list
# This allows for nickname to be used for short name
# eg Phil S is adding Phil Sargent to the list
if str(personexpedition.nickname.lower() + " " + l) not in possnames:
possnames.append(personexpedition.nickname.lower() + " " + l)
if str(personexpedition.nickname.lower() + " " + l[0]) not in possnames: