This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 95a9b04  [slice_json] pass slice id to get_form_data() (#4607)
95a9b04 is described below

commit 95a9b046f863d3ce46cae5ad80ffe17a086c9219
Author: Chris Williams <willias...@users.noreply.github.com>
AuthorDate: Tue Mar 13 14:49:06 2018 -0700

    [slice_json] pass slice id to get_form_data() (#4607)
---
 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 4e8f9bf..1d8ddf9 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/<slice_id>')
     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
ccwilli...@apache.org.

Reply via email to