On Apr 13, 2010, at 12:02 AM, Didip Kerabat wrote:

> Hi all, I'm trying to create cache decorator for logged out user. Below is 
> the snippet.
> 
> def logout_cache(*args, **kwargs):
>   from pylons import session
>   if session.get('user', None):

If it's none here, then this statement will be False, thus the else will be 
triggered. You probably want this to read:
if session.get('user', None) is None:

Which will render the non-cached page if there is no session['user'] key, or if 
the session['user'] key is None.

Cheers,
Ben

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to