From 36995ec05169974139fbfd6b768e6e935d97ab46 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Tue, 20 Sep 2022 02:36:40 +0300 Subject: handling survex files not linked in completely --- core/views/scans.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'core/views/scans.py') diff --git a/core/views/scans.py b/core/views/scans.py index f641423..80b334d 100644 --- a/core/views/scans.py +++ b/core/views/scans.py @@ -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() -- cgit v1.2.3