diff options
-rw-r--r-- | archaeological_operations/forms.py | 2 | ||||
-rw-r--r-- | ishtar_common/forms.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 447e7c2b6..11829fd47 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -89,7 +89,7 @@ class ParcelForm(IshtarForm): prefix_value = kwargs['prefix'] + '-town' if not [k for k in kwargs['data'].keys() if k.startswith(prefix_value) and kwargs['data'][k]]: - kwargs['data'] = {} + kwargs.pop('data') if 'files' in kwargs: kwargs.pop('files') super(ParcelForm, self).__init__(*args, **kwargs) diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index aede44637..20658d2de 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -552,6 +552,8 @@ class FormSet(CustomForm, BaseFormSet): Returns whether or not the form was marked for deletion. If no data, set deletion to True """ + if not hasattr(form, "cleaned_data"): + return if form.cleaned_data.get(DELETION_FIELD_NAME, False): return True if not form.cleaned_data or not [ |