From 989453e7f176e868c76db3579a005d4f4e3a2439 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 10 Oct 2017 11:46:28 -0700 Subject: [PATCH] [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. --- superset/jinja_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/jinja_context.py b/superset/jinja_context.py index e096ded2d55ef..a019ed382807f 100644 --- a/superset/jinja_context.py +++ b/superset/jinja_context.py @@ -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