From 5488d55f96832f7f06bbd4cbc182b0bf2ccd142e Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Wed, 23 May 2018 15:54:12 -0700 Subject: [PATCH] [dashboard v2] check for default_filters before json_loads-ing them (#5064) [dashboard v2] check for default_filters before json-loads-ing them --- superset/models/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/models/core.py b/superset/models/core.py index 95ee6dd90a4b6..4f1c33180f085 100644 --- a/superset/models/core.py +++ b/superset/models/core.py @@ -348,7 +348,7 @@ def url(self): json_metadata = json.loads(self.json_metadata) default_filters = json_metadata.get('default_filters') # make sure default_filters is not empty - if json.loads(default_filters): + if default_filters and json.loads(default_filters): filters = parse.quote(default_filters.encode('utf8')) return '/superset/dashboard/{}/?preselect_filters={}'.format( self.slug or self.id, filters)