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
Updated by Go MAEDA almost 2 years ago
- Related to Feature #16207: Use query name as the file name when exporting queries added
Updated by Go MAEDA almost 2 years ago
- Related to Feature #37674: Upgrade Admin/Users list to use the query system added
Updated by Takenori TAKAKI almost 2 years ago
- File 38182-with-test.patch 38182-with-test.patch added
It's a nice improvement that adds consistency to the download file names.
Attached is a patch with test code.
Updated by Go MAEDA almost 2 years ago
- Target version set to 5.1.0
Setting the target version to 5.1.0.
Updated by Go MAEDA almost 2 years ago
- Status changed from New to Closed
- Target version deleted (
5.1.0) - Resolution set to Fixed
Committed the fix as a part of #37674.
Actions