From 028ca98e5331c67a067f2cc53d95fd06233b68c5 Mon Sep 17 00:00:00 2001 From: Kara Engelhardt Date: Thu, 18 Apr 2024 17:45:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20crash=20in=20jzwb=20export?= =?UTF-8?q?=20if=20receipt-date=20is=20none?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fragdenstaat_de/fds_donation/export.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fragdenstaat_de/fds_donation/export.py b/fragdenstaat_de/fds_donation/export.py index 2e9385428..ae2baf74d 100644 --- a/fragdenstaat_de/fds_donation/export.py +++ b/fragdenstaat_de/fds_donation/export.py @@ -301,9 +301,11 @@ def get_donation_data(donations, ignore_receipt_date: Optional[datetime] = None) { "date": format_date(donation.received_timestamp), "formatted_amount": format_number(donation.amount), - "receipt_date": donation.receipt_date < ignore_receipt_date - if ignore_receipt_date is not None - else bool(donation.receipt_date), + "receipt_date": ( + donation.receipt_date < ignore_receipt_date + if ignore_receipt_date and donation.receipt_date + else bool(donation.receipt_date) + ), "amount": donation.amount, } for donation in donations