What would cause request identity to not be none but request.identity['user'] to be None

11 views
Skip to first unread message

Paul Kraus

unread,
Apr 29, 2015, 9:57:52 AM4/29/15
to turbo...@googlegroups.com
I have a strange issue that keeps popping up on my site where a random user will suddenly get 500 errors everywhere they go and this is because on my master template i display the logged in user and some how request.identity['user'] == None. 

I can't reproduce the issue i have tried to setting request.identity['user'] == None and i it just instantly shows me as logged on and i get no errors. 

It's very frustrating and there are some work arounds i could put in place but i would rather try and understand why its happening and the code a solution rather than a bandaid.


Thanks!



Alessandro Molina

unread,
Apr 29, 2015, 3:34:43 PM4/29/15
to TurboGears
This might happen in case the user existed at the time it logged in (so it has a valid token) but doesn't exist anymore on the database when it comes back (get_user is unable to find it).

It is usually enough to log users out in BaseController.__call__ in case they have an identity without a valid user.

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+...@googlegroups.com.
To post to this group, send email to turbo...@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages