On Tue, May 26, 2009 at 11:03 PM, Scott <[email protected]> wrote: > > How can I set variables in python / trac that are reset to null every > page load? According to your comment above I used class level > variables which persist across page reloads even when different people > are viewing the page. > > What I want to do every page load is (psudocode): > > user_authenticated = False > > if not user_authenticated: > run auth code > user_authenticated = True > > Problem is, the value or user_authenticated is saved across all page > loads, when I actually just want it set once and remembered for the > current page load by python / trac. Hopefully this explains what i'm > after.
Well, where is `user_authenticated` being set and what are you doing with it? Does it need to be passed along through multiple components in the course of the request? I assume yes, since otherwise there'd be little point to what you're asking. Anyways, req.authname already tells you whether or not a user has been authenticated, so I'm not sure why you would need to add something else for this. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Development" 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/trac-dev?hl=en -~----------~----~----~----~------~----~------~--~---
