Do you really need to show the message for the remainder of the
session? Or just when the page loads
right after the user has successfully subscribed? in this case you
could just delete the value after being "used":
if request.session.get('signed_up', True):
form.thanks = True
Maybe I'm missing something obvious, but can't you pass the user to the
template and use:
{% if user.is_authenticated %}
instead of:
{% if form.thanks %}
It doesn't solve the problem of logging out, but you don't have to handle
the session manually.
- Paulo
On Mon, Mar 22, 2010 at 9:40 PM, gr
I think the proper paradigm is to use the AnonymousUser.
Rather than trying to destroy the session - something that cannot be
reliably achieved - instead set the user of the session back to
AnonymousUser and test/react to that.
On Mar 23, 8:40 am, grimmus wrote:
> Basically all i want to do is
Basically all i want to do is the following :
Have a newsletter signup form. When the user signs up successfully the
area where the form was has a thanks message instead of the form.
The form or thanks message is displayed on every page of the site, so
I thought using a session would be the best
And if the user disables javascript, or kills the browser without
normal exit, or loses
his connection, or pulls the ethernet cable, or has a power failure?
On Mon, Mar 22, 2010 at 10:06 AM, Wiiboy wrote:
> Couldn't you use Javascript for this? For example, on the
> onbeforeunload event, delete t
Couldn't you use Javascript for this? For example, on the
onbeforeunload event, delete the sessionid cookie?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from
On Mon, Mar 22, 2010 at 11:17 AM, grimmus wrote:
> Hi,
>
> I have a simple newsletter signup form. If the user submits the form
> and there are no errors then i set the session:
>
> request.session['signed_up'] = True
>
> Then, for all other page requests i check if the session exists
>
>
Hi,
I have a simple newsletter signup form. If the user submits the form
and there are no errors then i set the session:
request.session['signed_up'] = True
Then, for all other page requests i check if the session exists
if request.session.get('signed_up', True):
for
8 matches
Mail list logo