diff options
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'), | 
