Skip to content

Commit 60f4b7c

Browse files
committed
[1.1.X] Fixed #1104: set FormWizard.extra_context in __init__ to avoid context leakage.
Backport of [12644] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12645 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 34a3b7b commit 60f4b7c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

django/contrib/formtools/wizard.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,25 @@
1616
from django.contrib.formtools.utils import security_hash
1717

1818
class FormWizard(object):
19-
# Dictionary of extra template context variables.
20-
extra_context = {}
21-
2219
# The HTML (and POST data) field name for the "step" variable.
2320
step_field_name="wizard_step"
2421

2522
# METHODS SUBCLASSES SHOULDN'T OVERRIDE ###################################
2623

2724
def __init__(self, form_list, initial=None):
28-
"form_list should be a list of Form classes (not instances)."
25+
"""
26+
Start a new wizard with a list of forms.
27+
28+
form_list should be a list of Form classes (not instances).
29+
"""
2930
self.form_list = form_list[:]
3031
self.initial = initial or {}
31-
self.step = 0 # A zero-based counter keeping track of which step we're in.
32+
33+
# Dictionary of extra template context variables.
34+
extra_context = {}
35+
36+
# A zero-based counter keeping track of which step we're in.
37+
self.step = 0
3238

3339
def __repr__(self):
3440
return "step: %d\nform_list: %s\ninitial_data: %s" % (self.step, self.form_list, self.initial)

0 commit comments

Comments
 (0)