diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-23 18:22:49 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-23 18:22:49 +0200 |
commit | 1ef0151057998c9f14f7653f2f58cb0c333e6348 (patch) | |
tree | 6d9f96614b7123c318dcc0d5fd670c2250cd03ba /archaeological_context_records/forms.py | |
parent | e5123c28e4ef5773d416b06805cec471ec432f57 (diff) | |
download | Ishtar-1ef0151057998c9f14f7653f2f58cb0c333e6348.tar.bz2 Ishtar-1ef0151057998c9f14f7653f2f58cb0c333e6348.zip |
Fix site modification
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r-- | archaeological_context_records/forms.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index 0504577c5..a4577df40 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -244,11 +244,11 @@ class RecordFormGeneral(CustomForm, ManageOldType): (" - ".join([k for k in key if k]), [(parcel.pk, parcel.short_label) for parcel in gparcels]) ) - if len(self.fields['parcel'].choices) == 1: + if len(self.fields['parcel'].choices) == 1 and \ + 'town' in self.fields: # only the empty choice is available self.fields.pop('parcel') - if 'town' in self.fields: - self.fields['town'].required = True + self.fields['town'].required = True if 'town' in self.fields: if self.fields['town'].required: self.fields['town'].choices = [] # remove the empty choice |