From 71bd07e70e542df553c595096dede77ea9569052 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Tue, 20 Sep 2022 22:52:31 +0300 Subject: Handling and fixing bad dates in JSON input --- core/views/scans.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'core/views/scans.py') diff --git a/core/views/scans.py b/core/views/scans.py index 80b334d..d3fd517 100644 --- a/core/views/scans.py +++ b/core/views/scans.py @@ -82,12 +82,15 @@ def fillblankpeople(w): # this isn't working..? why? Because it needs a *ref and an import wp = w.people() 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) + if not wp: + populatewallet(w) + else: + 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