diff --git a/client/app/pages/queries/view.js b/client/app/pages/queries/view.js index b230ab4dc0..276feab73b 100644 --- a/client/app/pages/queries/view.js +++ b/client/app/pages/queries/view.js @@ -400,7 +400,7 @@ function QueryViewCtrl( } if (status === 'done') { - const ranSelectedQuery = $scope.query.query !== $scope.queryResult.query; + const ranSelectedQuery = $scope.query.query !== $scope.queryResult.query_result.query; if (!ranSelectedQuery) { $scope.query.latest_query_data_id = $scope.queryResult.getId(); $scope.query.queryResult = $scope.queryResult; @@ -445,6 +445,9 @@ function QueryViewCtrl( $scope.saveQuery().then((query) => { // Because we have a path change, we need to "signal" the next page to // open the visualization editor. + // TODO: we don't really need this. Just need to assign query to $scope.query + // and maybe a few more small changes. Not worth handling this now, but also + // we shouldn't copy this bizzare method to the React codebase. $location.path(query.getSourceLink()).hash('add'); }); } else { diff --git a/redash/handlers/queries.py b/redash/handlers/queries.py index bd43c69576..0fc867ae8e 100644 --- a/redash/handlers/queries.py +++ b/redash/handlers/queries.py @@ -228,7 +228,7 @@ def post(self): 'object_type': 'query' }) - return QuerySerializer(query).serialize() + return QuerySerializer(query, with_visualizations=True).serialize() class QueryArchiveResource(BaseQueryListResource):