From 1835d67daf29f6b20489c779219c8d531cb1d04a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 9 May 2018 16:16:20 +0200 Subject: Only one main image is possible (refs #4076) --- archaeological_operations/forms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'archaeological_operations/forms.py') 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") -- cgit v1.2.3