From commits-return-761-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Tue Mar 13 19:50:49 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 4F40C18067B for ; Tue, 13 Mar 2018 19:50:49 +0100 (CET) Received: (qmail 11823 invoked by uid 500); 13 Mar 2018 18:50:48 -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 11797 invoked by uid 99); 13 Mar 2018 18:50:48 -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; Tue, 13 Mar 2018 18:50:48 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 84AB3809A0; Tue, 13 Mar 2018 18:50:47 +0000 (UTC) Date: Tue, 13 Mar 2018 18:50:48 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] 01/01: [slice_json] pass slice id to get_form_data() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: ccwilliams@apache.org In-Reply-To: <152096704731.14819.17993830532164648956@gitbox.apache.org> References: <152096704731.14819.17993830532164648956@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/chris--fix-annotations X-Git-Reftype: branch X-Git-Rev: 0210bf052287a5764951b7b5c26b5887b24856ef X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180313185047.84AB3809A0@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. ccwilliams pushed a commit to branch chris--fix-annotations in repository https://gitbox.apache.org/repos/asf/incubator-superset.git commit 0210bf052287a5764951b7b5c26b5887b24856ef Author: Chris Williams AuthorDate: Tue Mar 13 11:50:31 2018 -0700 [slice_json] pass slice id to get_form_data() --- superset/views/core.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/superset/views/core.py b/superset/views/core.py index ad06b25..c05eaa6 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -998,6 +998,7 @@ class Superset(BaseSupersetView): # the form_data from the DB with the other form_data provided slice_id = form_data.get('slice_id') or slice_id slc = None + if slice_id: slc = db.session.query(models.Slice).filter_by(id=slice_id).first() slice_form_data = slc.form_data.copy() @@ -1122,10 +1123,10 @@ class Superset(BaseSupersetView): @expose('/slice_json/') def slice_json(self, slice_id): try: - viz_obj = self.get_viz(slice_id) - datasource_type = viz_obj.datasource.type - datasource_id = viz_obj.datasource.id - form_data, slc = self.get_form_data() + form_data, slc = self.get_form_data(slice_id) + datasource_type = slc.datasource.type + datasource_id = slc.datasource.id + except Exception as e: return json_error_response( utils.error_msg_from_exception(e), -- To stop receiving notification emails like this one, please contact ccwilliams@apache.org.