Ticket #17148: 17148.alternative.diff

File 17148.alternative.diff, 1.4 KB (added by julien, 3 years ago)
  • django/contrib/formtools/wizard/views.py

    diff --git a/django/contrib/formtools/wizard/views.py b/django/contrib/formtools/wizard/views.py
    index 15ba146..e3cd320 100644
    a b class WizardView(TemplateView): 
    497497            step = self.steps.current
    498498        return self.get_form_list().keyOrder.index(step)
    499499
    500     def get_context_data(self, form, *args, **kwargs):
     500    def get_context_data(self, form, **kwargs):
    501501        """
    502502        Returns the template context for a step. You can overwrite this method
    503503        to add more data for all or some steps. This method returns a
    class WizardView(TemplateView): 
    512512
    513513        .. code-block:: python
    514514
    515             class MyWizard(FormWizard):
     515            class MyWizardView(WizardView):
    516516                def get_context_data(self, form, **kwargs):
    517                     context = super(MyWizard, self).get_context_data(form, **kwargs)
     517                    context = super(MyWizardView, self).get_context_data(form, **kwargs)
    518518                    if self.steps.current == 'my_step_name':
    519519                        context.update({'another_var': True})
    520520                    return context
    521521        """
    522         context = super(WizardView, self).get_context_data(*args, **kwargs)
     522        context = super(WizardView, self).get_context_data(**kwargs)
    523523        context.update(self.storage.extra_data)
    524524        context['wizard'] = {
    525525            'form': form,
Back to Top