From commits-return-1127-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Fri Jun 22 02:54:19 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B3B831807A3 for ; Fri, 22 Jun 2018 02:54:18 +0200 (CEST) Received: (qmail 41439 invoked by uid 500); 22 Jun 2018 00:54:17 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 41364 invoked by uid 99); 22 Jun 2018 00:54:17 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jun 2018 00:54:17 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 7351E850CC; Fri, 22 Jun 2018 00:54:16 +0000 (UTC) Date: Fri, 22 Jun 2018 00:54:27 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] 12/26: [dashboard v2] check for default_filters before json_loads-ing them (#5064) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: ccwilliams@apache.org In-Reply-To: <152962885522.16472.1136442268545544298@gitbox.apache.org> References: <152962885522.16472.1136442268545544298@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/dashboard-builder X-Git-Reftype: branch X-Git-Rev: a02d8584df96454ea7dff5879120e4a2cab8b73b X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180622005416.7351E850CC@gitbox.apache.org> 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 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)