superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccwilli...@apache.org
Subject [incubator-superset] 12/26: [dashboard v2] check for default_filters before json_loads-ing them (#5064)
Date Fri, 22 Jun 2018 00:54:27 GMT
This is an automated email from the ASF dual-hosted git repository.

ccwilliams pushed a commit to branch dashboard-builder
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit a02d8584df96454ea7dff5879120e4a2cab8b73b
Author: Chris Williams <williaster@users.noreply.github.com>
AuthorDate: Wed May 23 15:54:12 2018 -0700

    [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 df0aafc..0ef3331 100644
--- a/superset/models/core.py
+++ b/superset/models/core.py
@@ -348,7 +348,7 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
             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)


Mime
View raw message