diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-02-23 12:01:23 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-02-23 12:01:23 +0100 |
commit | 12f16ac2a3098ae12fc73ca73e527ba5041dedbd (patch) | |
tree | 4631bcb768a6a1840d81bad168da2006cf031bda /archaeological_operations/views.py | |
parent | 32dfcf7a656f99f4ec6251023a6b3cd82bc874ef (diff) | |
download | Ishtar-12f16ac2a3098ae12fc73ca73e527ba5041dedbd.tar.bz2 Ishtar-12f16ac2a3098ae12fc73ca73e527ba5041dedbd.zip |
Improve modularity
Diffstat (limited to 'archaeological_operations/views.py')
-rw-r--r-- | archaeological_operations/views.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 22d820b5b..11e1d8711 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -232,6 +232,7 @@ operation_search_wizard = SearchWizard.as_view([ url_name='operation_search',) wizard_steps = [ + ('filechoice-operation_creation', OperationFormFileChoice), ('general-operation_creation', OperationFormGeneral), ('preventive-operation_creation', OperationFormPreventive), ('preventivediag-operation_creation', OperationFormPreventiveDiag), @@ -244,16 +245,19 @@ wizard_steps = [ ('relations-operation_creation', RecordRelationsFormSet), ('abstract-operation_creation', OperationFormAbstract), ('final-operation_creation', FinalForm)] -if get_current_profile().files: - wizard_steps.insert(0, ('filechoice-operation_creation', - OperationFormFileChoice)) + + +def check_files_for_operation(self): + if not check_rights_condition(['view_file'])(self): + return False + return get_current_profile().files operation_creation_wizard = OperationWizard.as_view( wizard_steps, label=_(u"New operation"), condition_dict={ 'filechoice-operation_creation': - check_rights_condition(['view_file']), + check_files_for_operation, 'preventive-operation_creation': is_preventive('general-operation_creation', models.OperationType, 'operation_type', 'prev_excavation'), |