diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-05-09 16:16:20 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-12 08:44:18 +0200 |
commit | 1835d67daf29f6b20489c779219c8d531cb1d04a (patch) | |
tree | da54bcbaf7fb2c6009cce587fed610d4d12c6e18 /archaeological_operations/forms.py | |
parent | 4d9d105d21339e7236c69f47ce26f195749c3d10 (diff) | |
download | Ishtar-1835d67daf29f6b20489c779219c8d531cb1d04a.tar.bz2 Ishtar-1835d67daf29f6b20489c779219c8d531cb1d04a.zip |
Only one main image is possible (refs #4076)
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index c780fdcd7..b6304d14d 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -52,7 +52,7 @@ from ishtar_common.forms import FinalForm, FormSet, get_now, \ reverse_lazy, get_form_selection, TableSelect, get_data_from_formset, \ ManageOldType, IshtarForm, CustomForm, FieldType, FormSetWithDeleteSwitches from ishtar_common.forms_common import TownFormSet, SourceForm, SourceSelect, \ - get_town_field, TownForm, get_image_help, BaseImageForm + get_town_field, TownForm, get_image_help, BaseImageForm, BaseImageFormset from archaeological_operations.utils import parse_parcels @@ -911,8 +911,8 @@ class OperationFormGeneral(CustomForm, ManageOldType): # verify the logic between start date and excavation end date if self.are_available(['excavation_end_date', 'start_date']) \ - and cleaned_data.get('excavation_end_date'): - if not self.cleaned_data['start_date']: + and cleaned_data.get('excavation_end_date', None): + if not cleaned_data.get('start_date', None): raise forms.ValidationError( _(u"If you want to set an excavation end date you " u"have to provide a start date.")) @@ -1026,7 +1026,7 @@ class CollaboratorForm(CustomForm, IshtarForm): ImagesFormset = formset_factory(BaseImageForm, can_delete=True, - formset=FormSet) + formset=BaseImageFormset) ImagesFormset.file_upload = True ImagesFormset.form_label = _(u"Images") ImagesFormset.form_admin_name = _(u"Operation - 025 - Images") |