mirror of
https://github.com/getredash/redash.git
synced 2026-05-13 06:00:53 -04:00
Fix: on first save, make sure we load alredy existing data
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
|
||||
if (isNewQuery) {
|
||||
// redirect to new created query (keep hash)
|
||||
$location.path(savedQuery.getSourceLink()).replace();
|
||||
$location.path(savedQuery.getSourceLink());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ class QueryListResource(BaseResource):
|
||||
for field in ['id', 'created_at', 'api_key', 'visualizations', 'latest_query_data', 'last_modified_by']:
|
||||
query_def.pop(field, None)
|
||||
|
||||
# If we already executed this query, save the query result reference
|
||||
if 'latest_query_data_id' in query_def:
|
||||
query_def['latest_query_data'] = query_def.pop('latest_query_data_id')
|
||||
|
||||
query_def['user'] = self.current_user
|
||||
query_def['data_source'] = data_source
|
||||
query_def['org'] = self.current_org
|
||||
|
||||
Reference in New Issue
Block a user