From 3c87272fdc87894d1e516d35786e3802e647a753 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 4 Dec 2019 10:29:26 +0100 Subject: [PATCH] Bank transfer import: Fix crash when no date column is selected --- src/pretix/plugins/banktransfer/csvimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pretix/plugins/banktransfer/csvimport.py b/src/pretix/plugins/banktransfer/csvimport.py index c924cc51f5..d5369f3fbf 100644 --- a/src/pretix/plugins/banktransfer/csvimport.py +++ b/src/pretix/plugins/banktransfer/csvimport.py @@ -28,7 +28,7 @@ def parse(data, hint): resrow['amount'] = re.sub('[^0-9,+.-]', '', resrow['amount']) if hint.get('date') is not None: resrow['date'] = row[int(hint.get('date'))].strip() - if len(resrow['amount']) == 0 or 'amount' not in resrow or resrow['date'] == '': + if len(resrow['amount']) == 0 or 'amount' not in resrow or resrow.get('date') == '': # This is probably a headline or something other special. continue if resrow.get('reference') or resrow.get('payer'):