handling survex files not linked in completely

This commit is contained in:
Philip Sargent
2022-09-20 02:36:40 +03:00
parent 61f9863a06
commit 36995ec051
3 changed files with 56 additions and 42 deletions

View File

@@ -35,6 +35,9 @@ add this file in to the todo list thinggy.
def populatewallet(w):
'''Copy survex data here just for display, not permanently
Only gets data from the survex file when it was parsed on import..
so doesn't work if there is no *ref value
'''
survexpeople = []
blocks = SurvexBlock.objects.filter(scanswallet = w)
@@ -76,16 +79,15 @@ def caveifywallet(w):
w.displaynames = blocknames
def fillblankpeople(w):
# this isn't working..? why?
# this isn't working..? why? Because it needs a *ref and an import
wp = w.people()
if not wp: # an -empty list
populatewallet(w)
else:
w.persons = wp
if len(wp) == 1:
nobody = wp[0].lower()
if nobody == 'unknown' or nobody == 'nobody' or nobody == ' ' or nobody == '':
populatewallet(w)
w.persons = wp
if len(wp) == 1:
# print(f' - {wp=}')
nobody = wp[0].lower()
if nobody == 'unknown' or nobody == 'nobody' or nobody == ' ' or nobody == '':
print(f' - {wp=} {nobody=}')
populatewallet(w)
def fillblankothers(w):
earliest = datetime.datetime.now().date()