diff options
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r-- | ishtar_common/wizards.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 979f611ce..4a55345d2 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -87,7 +87,16 @@ def filter_no_fields_form(form, other_check=None): return func -class Wizard(NamedUrlWizardView): +class IshtarWizard(NamedUrlWizardView): + def get_form_kwargs(self, step=None): + kwargs = super(IshtarWizard, self).get_form_kwargs(step) + if hasattr(self.form_list[step], 'need_user_for_initialization') and \ + self.form_list[step].need_user_for_initialization: + kwargs['user'] = self.request.user + return kwargs + + +class Wizard(IshtarWizard): model = None label = '' translated_keys = [] @@ -167,13 +176,6 @@ class Wizard(NamedUrlWizardView): return super(Wizard, self).dispatch(request, *args, **kwargs) - def get_form_kwargs(self, step=None): - kwargs = super(Wizard, self).get_form_kwargs(step) - if hasattr(self.form_list[step], 'need_user_for_initialization') and\ - self.form_list[step].need_user_for_initialization: - kwargs['user'] = self.request.user - return kwargs - def get_prefix(self, request, *args, **kwargs): """As the class name can interfere when reused prefix with the url_name """ @@ -1382,7 +1384,7 @@ class Wizard(NamedUrlWizardView): return initial -class SearchWizard(NamedUrlWizardView): +class SearchWizard(IshtarWizard): model = None label = '' modification = None # True when the wizard modify an item |