Exporting UserQuery does not use the query name as file name (#37674, #38182).

Patch by Takenori TAKAKI.


git-svn-id: https://svn.redmine.org/redmine/trunk@22121 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2023-03-01 08:47:28 +00:00
parent a499d68802
commit 4dc56cd943
2 changed files with 14 additions and 1 deletions

View File

@@ -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