From 3a028bad4c9de415eae5da22da0672e15ae399a8 Mon Sep 17 00:00:00 2001 From: monodo Date: Thu, 22 Jun 2023 10:51:46 +0200 Subject: [PATCH] handle null values in sent_date --- geocity/apps/submissions/search.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geocity/apps/submissions/search.py b/geocity/apps/submissions/search.py index 5b611b960..b612e11e2 100644 --- a/geocity/apps/submissions/search.py +++ b/geocity/apps/submissions/search.py @@ -587,7 +587,9 @@ def search_result_to_json(result): "author": result.author_name, "status": result.submission_status, "createdAt": result.submission_created_at.strftime("%d.%m.%Y"), - "sentDate": result.submission_sent_date.strftime("%d.%m.%Y"), + "sentDate": result.submission_sent_date.strftime("%d.%m.%Y") + if result.submission_sent_date + else "", }, "match": { "fieldLabel": result.field_label,