summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
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
commit4d1c74baf591f6e021f7820b381fa962e3317bcd (patch)
tree4ef8274ec69b07fa4141c091ffc662f03ed22b61 /archaeological_operations
parentb15ca19df32888c2ab22489e4d6965537dc0d389 (diff)
downloadIshtar-4d1c74baf591f6e021f7820b381fa962e3317bcd.tar.bz2
Ishtar-4d1c74baf591f6e021f7820b381fa962e3317bcd.zip
Filter deadline fields for warehouse manager only (refs #3191)
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/forms.py12
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'))