mirror of
https://github.com/apache/superset.git
synced 2024-09-12 16:49:40 -04:00
[slice_json] pass slice id to get_form_data() (#4607)
This commit is contained in:
parent
4250e239a2
commit
95a9b046f8
@ -998,6 +998,7 @@ class Superset(BaseSupersetView):
|
|||||||
# the form_data from the DB with the other form_data provided
|
# the form_data from the DB with the other form_data provided
|
||||||
slice_id = form_data.get('slice_id') or slice_id
|
slice_id = form_data.get('slice_id') or slice_id
|
||||||
slc = None
|
slc = None
|
||||||
|
|
||||||
if slice_id:
|
if slice_id:
|
||||||
slc = db.session.query(models.Slice).filter_by(id=slice_id).first()
|
slc = db.session.query(models.Slice).filter_by(id=slice_id).first()
|
||||||
slice_form_data = slc.form_data.copy()
|
slice_form_data = slc.form_data.copy()
|
||||||
@ -1122,10 +1123,10 @@ class Superset(BaseSupersetView):
|
|||||||
@expose('/slice_json/<slice_id>')
|
@expose('/slice_json/<slice_id>')
|
||||||
def slice_json(self, slice_id):
|
def slice_json(self, slice_id):
|
||||||
try:
|
try:
|
||||||
viz_obj = self.get_viz(slice_id)
|
form_data, slc = self.get_form_data(slice_id)
|
||||||
datasource_type = viz_obj.datasource.type
|
datasource_type = slc.datasource.type
|
||||||
datasource_id = viz_obj.datasource.id
|
datasource_id = slc.datasource.id
|
||||||
form_data, slc = self.get_form_data()
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return json_error_response(
|
return json_error_response(
|
||||||
utils.error_msg_from_exception(e),
|
utils.error_msg_from_exception(e),
|
||||||
|
Loading…
Reference in New Issue
Block a user