Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #669: save fails when doing partial save of new query #1126

Merged
merged 2 commits into from
Jun 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bin/pre_compile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# heroku pre_compile script
# Heroku pre_compile script

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd $DIR/..
Expand All @@ -8,8 +8,9 @@ pushd $DIR/..
# https://github.com/heroku/heroku-buildpack-python/blob/master/bin/steps/cryptography
# to avoid making it a requirement for other build systems, we'll inject it now
# into the requirements.txt file
# remove pymssql, it doesn't compile on heroku
grep -v '^pymssql' requirements_all_ds.txt >> requirements.txt

# Remove Heroku unsupported Python packages:
grep -v -E "^(pymssql|thrift|sasl|pyhive)" requirements_all_ds.txt >> requirements.txt

# make the heroku Procfile the active one
cp Procfile.heroku Procfile
Expand Down
4 changes: 4 additions & 0 deletions rd_ui/app/scripts/controllers/query_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
$scope.saveQuery = function(options, data) {
var savePromise = saveQuery(options, data);

if (!savePromise) {
return;
}

savePromise.then(function(savedQuery) {
queryText = savedQuery.query;
$scope.isDirty = $scope.query.query !== queryText;
Expand Down
4 changes: 4 additions & 0 deletions rd_ui/app/scripts/controllers/query_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@

$scope.saveQuery = function(options, data) {
if (data) {
// Don't save new query with partial data
if ($scope.query.isNew()) {
return;
}
data.id = $scope.query.id;
} else {
data = _.pick($scope.query, ["schedule", "query", "id", "description", "name", "data_source_id", "options"]);
Expand Down