>> when a user logs in and gets redirected to the order page the wizard 
starts again from the beginning (loosing all the data inserted the first 
time).

The issue is that in WizardView, triggering the get function causes the session 
to 
reset<https://github.com/django/django/blob/master/django/contrib/formtools/wizard/views.py#L243>.
 
I would suggest that you switch from using a plain SessionWizardView to 
a NamedUrlWizardView.

>> Can I keep/move the wizard session data from the anonymous user to the 
logged user?

I believe that session data is only cleaned when you log out, however when 
logging in you should not loose that data.

On Thursday, February 13, 2014 9:51:08 AM UTC-5, parnigot wrote:
>
> Hello fellow django users,
>
> I’m using a form wizard (a very basic SessionWizardView) to create a 
> simple “order page”.
> The four steps of the wizard must be accessible to both logged in and 
> anonymous users, but to complete an order the user must authenticate 
> himself (think something like an online shop where you can add what you 
> want to the basket but to complete an order you have to log in).
>
> To accomplish this, in the wizard’s done() method, I redirect anonymous 
> users to the login page with a ?next=/order-page/ parameter.
> But this doesn’t work very well, because when a user logs in and gets 
> redirected to the order page the wizard starts again from the beginning 
> (loosing all the data inserted the first time).
>
> Can I keep/move the wizard session data from the anonymous user to the 
> logged user?
>
> ---
> Best regards,
> e.p.
> <https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#django.contrib.formtools.wizard.views.SessionWizardView>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ec968123-98f8-4905-b621-0aa93bd8cf4e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to