Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
  • Loading branch information...
commit 60f4b7c4a9243e0e9d5e2a1b441548dc0cb8727d 1 parent 34a3b7b
Jacob Kaplan-Moss authored March 01, 2010

Showing 1 changed file with 11 additions and 5 deletions. Show diff stats Hide diff stats

  1. 16  django/contrib/formtools/wizard.py
16  django/contrib/formtools/wizard.py
@@ -16,19 +16,25 @@
16 16
 from django.contrib.formtools.utils import security_hash
17 17
 
18 18
 class FormWizard(object):
19  
-    # Dictionary of extra template context variables.
20  
-    extra_context = {}
21  
-
22 19
     # The HTML (and POST data) field name for the "step" variable.
23 20
     step_field_name="wizard_step"
24 21
 
25 22
     # METHODS SUBCLASSES SHOULDN'T OVERRIDE ###################################
26 23
 
27 24
     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
+        """
29 30
         self.form_list = form_list[:]
30 31
         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 
32 38
 
33 39
     def __repr__(self):
34 40
         return "step: %d\nform_list: %s\ninitial_data: %s" % (self.step, self.form_list, self.initial)

0 notes on commit 60f4b7c

Please sign in to comment.
Something went wrong with that request. Please try again.