You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have looked at Issue #121. Someone provides creating a decorator as a solution, this seems inconvenient as i'm trying to use globals().get('user') in the layout. I get that that works, but I still find it weird that it stops existing.
Literally right after I create another database, globals().get('user') ceases to exist within views and controllers. However, globals().get('auth') does exist, but only within the controller.
This is for globals().get('auth') within the index() controller:
Do not understand what you mean by "stop existing". I suspect this has to do with the order of validators. auth and auth.user fixtures should inject the user in template. template must appear first in the list of fixtures. If problem persists, can you provide an example app?
As it's been quite some time since I touched py4web, I'll see if I have time tonight to try and reproduce the issue in the most recent version. Keep you posted.
I have looked at Issue #121. Someone provides creating a decorator as a solution, this seems inconvenient as i'm trying to use
globals().get('user')
in the layout. I get that that works, but I still find it weird that it stops existing.Literally right after I create another database,
globals().get('user')
ceases to exist within views and controllers. However,globals().get('auth')
does exist, but only within the controller.This is for
globals().get('auth')
within theindex()
controller:and this is for
globals().get('user')
within theindex()
controller.calling either
globals().get("auth")
orglobals().get('user')
in a view, just returns None.The text was updated successfully, but these errors were encountered: