From e65e8fe36c57651d272ace86b539560cbc21fef6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 6 Mar 2018 12:02:37 +0100 Subject: Parcel not mandatory: change required in form (refs #3962) --- archaeological_context_records/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index 61460ab3b..6e7c3602e 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -227,7 +227,10 @@ class RecordFormGeneral(CustomForm, ManageOldType): if 'files' in kwargs: kwargs.pop('files') super(RecordFormGeneral, self).__init__(*args, **kwargs) + profile = IshtarSiteProfile.get_current_profile() self.fields['parcel'].choices = [('', '--')] + if not profile.parcel_mandatory: + self.fields['parcel'].required = False site_label = IshtarSiteProfile.get_default_site_label() self.fields['archaeological_site'].label = site_label -- cgit v1.2.3