Actions
Defect #38182
closedExporting users query does not use the query name as file name
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Accounts / authentication
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
#16207 implemented a feature that uses the query name as a file name when exporting a query, but the fixed name "users.csv" is still used when exporting a users query.
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index a6cad6b2f..77ec1a601 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -61,7 +61,7 @@ class UsersController < ApplicationController
format.csv do
# Export all entries
@entries = scope.to_a
- send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => 'users.csv')
+ send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'users')}.csv")
end
format.api do
@offset, @limit = api_offset_and_limit
Files
Related issues
Actions