Project

General

Profile

Actions

Defect #38182

closed

Exporting users query does not use the query name as file name

Added by Go MAEDA over 1 year ago. Updated over 1 year ago.

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

38182-with-test.patch (1.71 KB) 38182-with-test.patch Takenori TAKAKI, 2023-02-01 04:06

Related issues

Related to Redmine - Feature #16207: Use query name as the file name when exporting queries ClosedGo MAEDA

Actions
Related to Redmine - Feature #37674: Upgrade Admin/Users list to use the query systemClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF