Skip to content

Commit

Permalink
[bugfix] Template rendering failed: '_AppCtxGlobals' object has no at…
Browse files Browse the repository at this point in the history
…tribute 'user' (apache#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.
  • Loading branch information
mistercrunch authored and michellethomas committed May 23, 2018
1 parent 3c1383c commit 989453e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion superset/jinja_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 989453e

Please sign in to comment.