From fe18fc6fd656d3f303f7bb4919a4461d4d68f9e2 Mon Sep 17 00:00:00 2001 From: Pawan Verma Date: Wed, 27 Nov 2024 17:45:08 +0530 Subject: [PATCH] Fix add check for no end_date --- commcare_connect/opportunity/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commcare_connect/opportunity/forms.py b/commcare_connect/opportunity/forms.py index dc1f4fae..056c8453 100644 --- a/commcare_connect/opportunity/forms.py +++ b/commcare_connect/opportunity/forms.py @@ -692,7 +692,7 @@ def clean(self): "optional_deliver_units", error=f"{deliver_unit_obj.name} cannot be marked both Required and Optional", ) - if cleaned_data["end_date"] < now().date(): + if cleaned_data["end_date"] and cleaned_data["end_date"] < now().date(): self.add_error("end_date", "Please provide a valid end date.") return cleaned_data