diff options
Diffstat (limited to 'archaeological_files_pdl/wizards.py')
| -rw-r--r-- | archaeological_files_pdl/wizards.py | 17 | 
1 files changed, 14 insertions, 3 deletions
| diff --git a/archaeological_files_pdl/wizards.py b/archaeological_files_pdl/wizards.py index 4abe5f0d5..6f688d7ca 100644 --- a/archaeological_files_pdl/wizards.py +++ b/archaeological_files_pdl/wizards.py @@ -25,12 +25,23 @@ class FileWizard(BaseFileWizard):      town_input_id = 'main_town'      multi_towns = False      wizard_templates = { -        'generalcontractor-file_creation':\ -                    'ishtar/wizard/wizard_generalcontractor.html',} +        'generalcontractor-%(url_name)s':\ +                    'ishtar/wizard/wizard_generalcontractor.html', +        'instruction-%(url_name)s':\ +                    'ishtar/wizard/wizard_instruction.html', +        'preventiveplanning-%(url_name)s':\ +                    'ishtar/wizard/wizard_preventiveplanning.html', +                    } + +    def get_current_year(self): +        general_form_key = 'general-' + self.url_name +        return self.session_get_value(general_form_key, 'year')      def get_form_kwargs(self, *args, **kwargs):          returned = super(FileWizard, self).get_form_kwargs(*args, **kwargs) -        if args and args[0].startswith('generalcontractor-file_creation'): +        if args and args[0].startswith('generalcontractor-'):              if 'status' in self.request.GET:                  returned['status'] = self.request.GET['status'] +        if args and args[0].startswith('instruction-'): +            returned['year'] = self.get_current_year()          return returned | 
