diff --git a/django/contrib/formtools/wizard.py b/django/contrib/formtools/wizard.py
index b97e090..c18d7ff 100644
a
|
b
|
class FormWizard(object):
|
76 | 76 | form = self.get_form(current_step, request.POST) |
77 | 77 | else: |
78 | 78 | form = self.get_form(current_step) |
79 | | if form.is_valid(): |
| 79 | if self.advance_form(request, form, current_step) and form.is_valid(): |
80 | 80 | self.process_step(request, form, current_step) |
81 | 81 | next_step = current_step + 1 |
82 | 82 | |
… |
… |
class FormWizard(object):
|
217 | 217 | previous_fields=previous_fields |
218 | 218 | ), context_instance=RequestContext(request)) |
219 | 219 | |
| 220 | def advance_form(self, request, form, step): |
| 221 | """ |
| 222 | Hook to decide if the next form in the list should be displayed. |
| 223 | |
| 224 | There are occassions when you may want to have a form with a button |
| 225 | that goes backwards. You can make the boolean decision to advance |
| 226 | to the next form, typically, using the existing form and the |
| 227 | current request. |
| 228 | |
| 229 | The rationale is that you may want to include the existing form data |
| 230 | when the form is being redisplayed. |
| 231 | """ |
| 232 | return True |
| 233 | |
220 | 234 | def process_step(self, request, form, step): |
221 | 235 | """ |
222 | 236 | Hook for modifying the FormWizard's internal state, given a fully |