diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-08 12:17:04 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-08 12:17:04 +0200 | 
| commit | 4d1c74baf591f6e021f7820b381fa962e3317bcd (patch) | |
| tree | 4ef8274ec69b07fa4141c091ffc662f03ed22b61 | |
| parent | b15ca19df32888c2ab22489e4d6965537dc0d389 (diff) | |
| download | Ishtar-4d1c74baf591f6e021f7820b381fa962e3317bcd.tar.bz2 Ishtar-4d1c74baf591f6e021f7820b381fa962e3317bcd.zip | |
Filter deadline fields for warehouse manager only (refs #3191)
| -rw-r--r-- | archaeological_operations/forms.py | 12 | 
1 files changed, 12 insertions, 0 deletions
| diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 0e56aa33b..4564eb37b 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -549,6 +549,13 @@ class OperationSelect(TableSelect):      def __init__(self, *args, **kwargs):          super(OperationSelect, self).__init__(*args, **kwargs) +        if not get_current_profile().warehouse: +            self.fields.pop('documentation_deadline_before') +            self.fields.pop('documentation_deadline_after') +            self.fields.pop('documentation_received') +            self.fields.pop('finds_deadline_before') +            self.fields.pop('finds_deadline_after') +            self.fields.pop('finds_received')          self.fields['operation_type'].choices = \              models.OperationType.get_types()          self.fields['operation_type'].help_text = \ @@ -836,6 +843,11 @@ 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')          self.fields['operation_type'].choices = \              models.OperationType.get_types(                  initial=self.init_data.get('operation_type')) | 
