diff options
Diffstat (limited to 'archaeological_operations/forms.py')
| -rw-r--r-- | archaeological_operations/forms.py | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 1a09b66b4..d0e4be0d3 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -89,7 +89,7 @@ class ParcelForm(forms.Form):                      kwargs.pop('files')          super(ParcelForm, self).__init__(*args, **kwargs)          if towns: -            self.fields['town'].choices = [('', '--')] + towns +            self.fields['town'].choices = towns      def clean(self):          """Check required fields""" @@ -98,9 +98,10 @@ class ParcelForm(forms.Form):          if not self.cleaned_data or (DELETION_FIELD_NAME in self.cleaned_data \             and self.cleaned_data[DELETION_FIELD_NAME]):              return -        if not self.cleaned_data.get('parcel_number'): +        if not self.cleaned_data.get('parcel_number') and \ +           self.cleaned_data.get('section') != 'DP':              return {} -        for key in ('town', 'parcel_number', 'section'): +        for key in ('town', 'section'):              if not key in self.cleaned_data or not self.cleaned_data[key]:                  raise forms.ValidationError(_(u"Town section and parcel number "                                                u"fields are required.")) | 
