On Dec 16, 2:31 am, 朱穆穆 <[email protected]> wrote:
> The extra_context in FormWizard is a class attribute so the new
> request may get the context of the previous request.
> I can prepend below to __call__ method to solved it:
>
> self.extra_context = self.extra_context.copy()
>
> Is this really a bug?
It's most probably a bug. See: http://code.djangoproject.com/ticket/8808
Basically, if you hook the FormWizard into your URL config as
documented at
http://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#hooking-the-wizard-into-a-urlconf,
anything you set in self.extra_context may become available to another
request.
Your fix to copy the extra_context doesn't solve this problem.
Quoting an excerpt from Jacob's response on that ticket: "I should
note that the workaround is very simple: either don't store state on
self, or instantiate the wizard in a view function. "
-Rajesh D
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---