Defect #38182
Exporting users query does not use the query name as file name
Status: | New | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | Accounts / authentication | |||
Target version: | 5.1.0 | |||
Resolution: | 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
Related issues
History
#1
Updated by Go MAEDA 16 days ago
- Related to Feature #16207: Use query name as the file name when exporting queries added
#2
Updated by Go MAEDA 16 days ago
- Related to Feature #37674: Upgrade Admin/Users list to use the query system added
#3
Updated by Takenori TAKAKI about 11 hours ago
- File 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.
#4
Updated by Go MAEDA about 6 hours ago
- Target version set to 5.1.0
Setting the target version to 5.1.0.