[bugfix] Template rendering failed: '_AppCtxGlobals' object has no attribute 'user' (#3637)

Somehow the nature of `g` in Flask has changed where `g.user` used to
be provided outside the web request scope and its not anymore.

The fix here should address that.
This commit is contained in:
Maxime Beauchemin
2017-10-10 11:46:28 -07:00
committed by GitHub
parent 8994bdacbd
commit b866b33dee

View File

@@ -43,7 +43,7 @@ def url_param(param, default=None):
def current_user_id():
"""The id of the user who is currently logged in"""
if g.user:
if hasattr(g, 'user') and g.user:
return g.user.id