Skip to content

Commit

Permalink
Merge pull request #1375 from moonami/issue-1247
Browse files Browse the repository at this point in the history
Fix: Download Dataset does not work when not logged in
  • Loading branch information
arikfr authored Nov 7, 2016
2 parents 61fe16e + 2184f53 commit d6febb0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rd_ui/app/scripts/directives/query_directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
if (scope.queryResult.getId() == null) {
element.attr('href', '');
} else {
element.attr('href', 'api/queries/' + scope.query.id + '/results/' + scope.queryResult.getId() + '.' + fileType);
element.attr('href', 'api/queries/' + scope.query.id + '/results/' + scope.queryResult.getId() + '.' + fileType + (scope.embed ? '?api_key=' + scope.apiKey : ''));
element.attr('download', scope.query.name.replace(" ", "_") + moment(scope.queryResult.getUpdatedAt()).format("_YYYY_MM_DD") + "." + fileType);
}
});
Expand Down
1 change: 1 addition & 0 deletions rd_ui/app/scripts/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ angular.module('redash', [
$scope.embed = true;
$scope.visualization = visualization;
$scope.query = visualization.query;
$scope.apiKey = $location.search()['api_key'];
query = new Query(visualization.query);
$scope.queryResult = new QueryResult({query_result: query_result});
}])
Expand Down

0 comments on commit d6febb0

Please sign in to comment.