Skip to content

Commit

Permalink
Check for None value
Browse files Browse the repository at this point in the history
  • Loading branch information
sravfeyn committed Nov 29, 2024
1 parent 4acf63d commit 41f5c25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commcare_connect/form_receiver/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 41f5c25

Please sign in to comment.