diff options
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 27ab4670a..041458ecd 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -857,21 +857,29 @@ class OperationFormGeneral(ManageOldType, forms.Form): def __init__(self, *args, **kwargs): super(OperationFormGeneral, self).__init__(*args, **kwargs) - if not get_current_profile().warehouse: - self.fields.pop('documentation_deadline') - self.fields.pop('documentation_received') - self.fields.pop('finds_deadline') - self.fields.pop('finds_received') + profile = get_current_profile() + if not profile.files: + self.fields.pop('report_delivery_date') + self.fields.pop('report_processing') + self.fields.pop('cira_rapporteur') + self.fields.pop('cira_date') + self.fields.pop('negative_result') + if not profile.warehouse: + self.fields.pop('documentation_deadline') + self.fields.pop('documentation_received') + self.fields.pop('finds_deadline') + self.fields.pop('finds_received') self.fields['operation_type'].choices = \ models.OperationType.get_types( initial=self.init_data.get('operation_type')) self.fields['operation_type'].help_text = \ models.OperationType.get_help() - self.fields['report_processing'].choices = \ - models.ReportState.get_types( - initial=self.init_data.get('report_processing')) - self.fields['report_processing'].help_text = \ - models.ReportState.get_help() + if 'report_processing' in self.fields: + self.fields['report_processing'].choices = \ + models.ReportState.get_types( + initial=self.init_data.get('report_processing')) + self.fields['report_processing'].help_text = \ + models.ReportState.get_help() self.fields['record_quality'].choices = \ [('', '--')] + list(models.QUALITY) if 'operation_code' in self.fields: |