forked from expo/troggle
small chnages to name resolution
This commit is contained in:
parent
c76cd38d76
commit
f51d1e114e
@ -145,7 +145,7 @@ def walletslistperson(request, first_name, last_name):
|
|||||||
if last_name:
|
if last_name:
|
||||||
p = Person.objects.get(fullname= f'{first_name} {last_name}')
|
p = Person.objects.get(fullname= f'{first_name} {last_name}')
|
||||||
else:
|
else:
|
||||||
# speciall Wookey-hack
|
# special Wookey-hack
|
||||||
p = Person.objects.get(first_name= f'{first_name}')
|
p = Person.objects.get(first_name= f'{first_name}')
|
||||||
except:
|
except:
|
||||||
#raise
|
#raise
|
||||||
|
@ -100,6 +100,8 @@ def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
|
|||||||
tripperson = "Phil Wigglesworth"
|
tripperson = "Phil Wigglesworth"
|
||||||
if tripperson =="Animal":
|
if tripperson =="Animal":
|
||||||
tripperson = "Mike Richardson"
|
tripperson = "Mike Richardson"
|
||||||
|
if tripperson =="MikeTA":
|
||||||
|
tripperson = "Mike Richardson"
|
||||||
|
|
||||||
|
|
||||||
personyear = GetPersonExpeditionNameLookup(expedition).get(tripperson.lower())
|
personyear = GetPersonExpeditionNameLookup(expedition).get(tripperson.lower())
|
||||||
|
@ -129,6 +129,11 @@ def load_people_expos():
|
|||||||
|
|
||||||
# used in other referencing parser functions
|
# used in other referencing parser functions
|
||||||
# expedition name lookup cached for speed (it's a very big list)
|
# 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 = { }
|
Gpersonexpeditionnamelookup = { }
|
||||||
def GetPersonExpeditionNameLookup(expedition):
|
def GetPersonExpeditionNameLookup(expedition):
|
||||||
global Gpersonexpeditionnamelookup
|
global Gpersonexpeditionnamelookup
|
||||||
@ -151,14 +156,15 @@ def GetPersonExpeditionNameLookup(expedition):
|
|||||||
possnames.append(f + " " + l[0])
|
possnames.append(f + " " + l[0])
|
||||||
possnames.append(f + l[0])
|
possnames.append(f + l[0])
|
||||||
possnames.append(f[0] + " " + l)
|
possnames.append(f[0] + " " + l)
|
||||||
|
possnames.append(f[0] + l[0]) # initials e.g. gb or bl
|
||||||
possnames.append(f)
|
possnames.append(f)
|
||||||
if full not in possnames:
|
if full not in possnames:
|
||||||
possnames.append(full)
|
possnames.append(full)
|
||||||
if personexpedition.nickname not in possnames:
|
if personexpedition.nickname not in possnames:
|
||||||
possnames.append(personexpedition.nickname.lower())
|
possnames.append(personexpedition.nickname.lower())
|
||||||
if l:
|
if l:
|
||||||
# This allows for nickname to be used for short name eg Phil
|
# This allows for nickname to be used for short name
|
||||||
# adding Phil Sargent to the list
|
# eg Phil S is adding Phil Sargent to the list
|
||||||
if str(personexpedition.nickname.lower() + " " + l) not in possnames:
|
if str(personexpedition.nickname.lower() + " " + l) not in possnames:
|
||||||
possnames.append(personexpedition.nickname.lower() + " " + l)
|
possnames.append(personexpedition.nickname.lower() + " " + l)
|
||||||
if str(personexpedition.nickname.lower() + " " + l[0]) not in possnames:
|
if str(personexpedition.nickname.lower() + " " + l[0]) not in possnames:
|
||||||
|
Loading…
Reference in New Issue
Block a user