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'

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 committed Oct 10, 2017
1 parent 64ef8b1 commit 28a83ee
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 28a83ee

Please sign in to comment.