summaryrefslogtreecommitdiff
path: root/archaeological_context_records/forms.py
diff options
context:
space:
mode:
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
commit2ae74b0b2a740b4055004778dc99e81769a52641 (patch)
tree6d9f96614b7123c318dcc0d5fd670c2250cd03ba /archaeological_context_records/forms.py
parent0150781e88386622703d627e586d391bac0d6836 (diff)
downloadIshtar-2ae74b0b2a740b4055004778dc99e81769a52641.tar.bz2
Ishtar-2ae74b0b2a740b4055004778dc99e81769a52641.zip
Fix site modification
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r--archaeological_context_records/forms.py6
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