diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-09 17:50:00 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-13 18:26:04 +0200 |
commit | 3ab10cd96173edd3786eb6fd69dbcc4ac0f4772e (patch) | |
tree | 9fc8f7a188e54dd18f5be1054ea442389ae0ee38 /archaeological_operations/forms.py | |
parent | 1bceebf5c01b7aaf58bba85544679e7e1d2cc257 (diff) | |
download | Ishtar-3ab10cd96173edd3786eb6fd69dbcc4ac0f4772e.tar.bz2 Ishtar-3ab10cd96173edd3786eb6fd69dbcc4ac0f4772e.zip |
search vector update: prevent circular referencing
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 20379e588..af4e21e31 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -739,13 +739,15 @@ class OperationFormGeneral(CustomForm, ManageOldType): form_slug = "operation-010-general" file_upload = True - associated_models = {'scientist': Person, - 'in_charge': Person, - 'cira_rapporteur': Person, - 'operator': Organization, - 'operation_type': models.OperationType, - 'report_processing': models.ReportState, - } + associated_models = { + 'scientist': Person, + 'in_charge': Person, + 'cira_rapporteur': Person, + 'operator': Organization, + 'operation_type': models.OperationType, + 'record_quality_type': models.RecordQualityType, + 'report_processing': models.ReportState + } pk = forms.IntegerField(required=False, widget=forms.HiddenInput) if settings.COUNTRY == 'fr': code_patriarche = forms.CharField(label=u"Code PATRIARCHE", @@ -841,8 +843,8 @@ class OperationFormGeneral(CustomForm, ManageOldType): scientific_documentation_comment = forms.CharField( label=_(u"Comment about scientific documentation"), widget=forms.Textarea, required=False) - record_quality = forms.ChoiceField(label=_(u"Record quality"), - required=False) + record_quality_type = forms.ChoiceField(label=_(u"Record quality"), + required=False) virtual_operation = forms.BooleanField(required=False, label=_(u"Virtual operation")) @@ -861,6 +863,7 @@ class OperationFormGeneral(CustomForm, ManageOldType): ] TYPES = [ FieldType('operation_type', models.OperationType), + FieldType('record_quality_type', models.RecordQualityType), FieldType('report_processing', models.ReportState), ] @@ -873,9 +876,6 @@ class OperationFormGeneral(CustomForm, ManageOldType): if not profile.warehouse: for key in self.WAREHOUSE_FIELDS: self.remove_field(key) - if 'record_quality' in self.fields: - self.fields['record_quality'].choices = \ - [('', '--')] + list(models.QUALITY) def clean(self): cleaned_data = self.cleaned_data |