summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2010-03-01 23:26:44 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2010-03-01 23:26:44 +0000
commit60f4b7c4a9243e0e9d5e2a1b441548dc0cb8727d (patch)
treed9c325db8a1c8cb6cfdf2b66a4d48655a2907c73
parent34a3b7b6fd288ce2e498b20506d16db84bd7c68b (diff)
[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
-rw-r--r--django/contrib/formtools/wizard.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/django/contrib/formtools/wizard.py b/django/contrib/formtools/wizard.py
index b075628c49..324acbe61c 100644
--- a/django/contrib/formtools/wizard.py
+++ b/django/contrib/formtools/wizard.py
@@ -16,19 +16,25 @@ from django.utils.translation import ugettext_lazy as _
from django.contrib.formtools.utils import security_hash
class FormWizard(object):
- # Dictionary of extra template context variables.
- extra_context = {}
-
# The HTML (and POST data) field name for the "step" variable.
step_field_name="wizard_step"
# METHODS SUBCLASSES SHOULDN'T OVERRIDE ###################################
def __init__(self, form_list, initial=None):
- "form_list should be a list of Form classes (not instances)."
+ """
+ Start a new wizard with a list of forms.
+
+ form_list should be a list of Form classes (not instances).
+ """
self.form_list = form_list[:]
self.initial = initial or {}
- self.step = 0 # A zero-based counter keeping track of which step we're in.
+
+ # Dictionary of extra template context variables.
+ extra_context = {}
+
+ # A zero-based counter keeping track of which step we're in.
+ self.step = 0
def __repr__(self):
return "step: %d\nform_list: %s\ninitial_data: %s" % (self.step, self.form_list, self.initial)