Ticket #16442: patch-16442.diff

File patch-16442.diff, 1.9 KB (added by anonymous, 7 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 2dab77d..887ed0e 100644
    a b class WizardView(TemplateView): 
    250250        wizard_prev_step = self.request.POST.get('wizard_prev_step', None)
    251251        if wizard_prev_step and wizard_prev_step in self.get_form_list():
    252252            self.storage.current_step = wizard_prev_step
    253             form = self.get_form(
     253            form = self.get_form(step=wizard_prev_step,
    254254                data=self.storage.get_step_data(self.steps.current),
    255255                files=self.storage.get_step_files(self.steps.current))
    256256            return self.render(form)
    class WizardView(TemplateView): 
    268268            self.storage.current_step = form_current_step
    269269
    270270        # get the form for the current step
    271         form = self.get_form(data=self.request.POST, files=self.request.FILES)
     271        form = self.get_form(step=self.steps.current, data=self.request.POST, files=self.request.FILES)
    272272
    273273        # and try to validate
    274274        if form.is_valid():
    class NamedUrlWizardView(WizardView): 
    617617        # if yes, change the step in the storage (if name exists)
    618618        elif step_url == self.steps.current:
    619619            # URL step name and storage step name are equal, render!
    620             return self.render(self.get_form(
     620            return self.render(self.get_form(step=step_url,
    621621                data=self.storage.current_step_data,
    622622                files=self.storage.current_step_data,
    623623            ), **kwargs)
    624624
    625625        elif step_url in self.get_form_list():
    626626            self.storage.current_step = step_url
    627             return self.render(self.get_form(
     627            return self.render(self.get_form(step=step_url,
    628628                data=self.storage.current_step_data,
    629629                files=self.storage.current_step_data,
    630630            ), **kwargs)
Back to Top