From 41f5c25e1e24c1fd9c2e3931332d757d7211f597 Mon Sep 17 00:00:00 2001 From: Sravan Reddy Date: Fri, 29 Nov 2024 16:15:38 +0530 Subject: [PATCH] Check for None value --- commcare_connect/form_receiver/processor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commcare_connect/form_receiver/processor.py b/commcare_connect/form_receiver/processor.py index 2872e81e..aa8c844a 100644 --- a/commcare_connect/form_receiver/processor.py +++ b/commcare_connect/form_receiver/processor.py @@ -262,7 +262,8 @@ def process_deliver_unit(user, xform: XForm, app: CommCareApp, opportunity: Oppo ) completed_work_needs_save = False today = datetime.date.today() - if opportunity.start_date > today or (payment_unit.start_date and payment_unit.start_date > today): + paymentunit_startdate = payment_unit.start_date if payment_unit else None + if opportunity.start_date > today or (paymentunit_startdate and paymentunit_startdate > today): completed_work = None user_visit.status = VisitValidationStatus.trial else: