Ticket #10810: wizard_revalidation.diff

File wizard_revalidation.diff, 1.4 KB (added by Qrilka, 15 years ago)

patch for FormWizard

  • django/contrib/formtools/wizard.py

     
    7676            self.process_step(request, form, current_step)
    7777            next_step = current_step + 1
    7878
    79             # If this was the last step, validate all of the forms one more
     79            # If this was the last step, validate all of the previous forms one more
    8080            # time, as a sanity check, and call done().
    8181            num = self.num_steps()
    8282            if next_step == num:
    83                 final_form_list = [self.get_form(i, request.POST) for i in range(num)]
     83                prior_form_list = [self.get_form(i, request.POST) for i in range(num - 1)]
    8484
    8585                # Validate all the forms. If any of them fail validation, that
    8686                # must mean the validator relied on some other input, such as
    8787                # an external Web site.
    88                 for i, f in enumerate(final_form_list):
     88                for i, f in enumerate(prior_form_list):
    8989                    if not f.is_valid():
    9090                        return self.render_revalidation_failure(request, i, f)
    91                 return self.done(request, final_form_list)
     91                return self.done(request, prior_form_list+[form])
    9292
    9393            # Otherwise, move along to the next step.
    9494            else:
Back to Top