Hello, I have  a form where I want that every time that a user want to
send it, he has to login.

So, before the view that render the form, I made another view where I
do request.session.flush() and after this, I redirect to the form (the
view of the form has @login_required).
User completes the form and send it, and it's stored in DB.

The problem is that when the user starts the process again, when
request.session.flush() is executed, the objects created in the
previous form and saved to the DB (I see it in pgAdmin) dissapear.
But this don't happens in all models saved in the form view, only
happens in the models that have a FK to User model.

What is happening here? If request.session.flush() isn't the correct
way to delete the session of a user, how I do that? (I store things in
session, this is the reason why I want to clean it before the user
enter new data trought the form)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to