diff options
Diffstat (limited to 'ishtar_common/wizards.py')
| -rw-r--r-- | ishtar_common/wizards.py | 14 | 
1 files changed, 12 insertions, 2 deletions
| diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 190a7fc86..1e515d13e 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -95,8 +95,11 @@ class Wizard(NamedUrlWizardView):      def get_template_names(self):          templates = ['ishtar/wizard/default_wizard.html']          current_step = self.steps.current -        if current_step in self.wizard_templates: -            templates = [self.wizard_templates[current_step]] + templates +        wizard_templates = dict([ +            (key % {'url_name':self.url_name}, self.wizard_templates[key]) +                            for key in self.wizard_templates]) +        if current_step in wizard_templates: +            templates = [wizard_templates[current_step]] + templates          elif current_step == self.steps.last:              templates = ['ishtar/wizard/confirm_wizard.html'] + templates          return templates @@ -617,6 +620,13 @@ class Wizard(NamedUrlWizardView):          return key in request.session[storage.prefix]['step_data'][form_key]      @classmethod +    def session_reset(cls, request, url_name): +        prefix = url_name + normalize_name(cls.__name__) +        storage = get_storage(cls.storage_name, prefix, request, +                              getattr(cls, 'file_storage', None)) +        storage.reset() + +    @classmethod      def session_set_value(cls, request, form_key, key, value, reset=False):          prefix = form_key.split('-')[1] + normalize_name(cls.__name__)          storage = get_storage(cls.storage_name, prefix, request, | 
