Ticket #10810: wizard_revalidation.diff
File wizard_revalidation.diff, 1.4 KB (added by , 16 years ago) |
---|
-
django/contrib/formtools/wizard.py
76 76 self.process_step(request, form, current_step) 77 77 next_step = current_step + 1 78 78 79 # If this was the last step, validate all of the forms one more79 # If this was the last step, validate all of the previous forms one more 80 80 # time, as a sanity check, and call done(). 81 81 num = self.num_steps() 82 82 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)] 84 84 85 85 # Validate all the forms. If any of them fail validation, that 86 86 # must mean the validator relied on some other input, such as 87 87 # an external Web site. 88 for i, f in enumerate( final_form_list):88 for i, f in enumerate(prior_form_list): 89 89 if not f.is_valid(): 90 90 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]) 92 92 93 93 # Otherwise, move along to the next step. 94 94 else: