From 641830616108b3f6e7210600a3b0a0f9f1a227a9 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 7 Feb 2022 11:29:57 +0100 Subject: Operation - Parcels - Modify: fix parcel deletion --- archaeological_operations/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'archaeological_operations/forms.py') diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 18a83f033..4034b94cd 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -116,12 +116,14 @@ class ParcelForm(IshtarForm): return if not self.cleaned_data or (DELETION_FIELD_NAME in self.cleaned_data and self.cleaned_data[DELETION_FIELD_NAME]): - print("Youpitralala") return if (not self.cleaned_data.get('parcel_number') or not self.cleaned_data.get('section')) and \ not self.cleaned_data.get('public_domain'): - return {} + # empty line reinit cleaned data + self.cleaned_data["year"] = None + self.cleaned_data["town"] = None + return self.cleaned_data if not self.cleaned_data.get('town'): raise forms.ValidationError(_("Town section is required.")) return self.cleaned_data -- cgit v1.2.3