Author: jacob Date: 2010-03-01 17:26:08 -0600 (Mon, 01 Mar 2010) New Revision: 12644
Modified: django/trunk/django/contrib/formtools/wizard.py Log: Fixed #1104: set `FormWizard.extra_context` in `__init__` to avoid context leakage. Modified: django/trunk/django/contrib/formtools/wizard.py =================================================================== --- django/trunk/django/contrib/formtools/wizard.py 2010-03-01 23:05:35 UTC (rev 12643) +++ django/trunk/django/contrib/formtools/wizard.py 2010-03-01 23:26:08 UTC (rev 12644) @@ -19,20 +19,26 @@ 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) -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.