diff --git a/caravel/views.py b/caravel/views.py index 4f4958def5e82..85c45e61119b4 100755 --- a/caravel/views.py +++ b/caravel/views.py @@ -1171,6 +1171,9 @@ def get_viz( args=None, datasource_type=None, datasource_id=None): + + slice_id = slice_id or args.get('slice_id') + if slice_id: slc = db.session.query(models.Slice).filter_by(id=slice_id).one() return slc.get_viz() diff --git a/tests/core_tests.py b/tests/core_tests.py index 85599c288908b..f0c182b66f4e8 100644 --- a/tests/core_tests.py +++ b/tests/core_tests.py @@ -115,7 +115,7 @@ def test_save_slice(self): "datasource_id=1&datasource_type=table&previous_viz_type=sankey") db.session.commit() - resp = self.get_resp(url.format(tbl_id, slice_id, copy_name, 'save')) + resp = self.get_resp(url.format(tbl_id, slice_id, copy_name, 'saveas')) assert copy_name in resp assert 'Energy' in self.get_resp( url.format(tbl_id, slice_id, copy_name, 'overwrite')) @@ -201,7 +201,7 @@ def test_warm_up_cache(self): resp = self.get_resp( '/caravel/warm_up_cache?table_name=energy_usage&db_name=main') data = json.loads(resp) - assert len(data) == 3 + assert len(data) == 4 def test_shortner(self): self.login(username='admin')