Skip to content

Commit

Permalink
Merge pull request #17156 from opf/bug/43829-unsorted-user-list-in-ti…
Browse files Browse the repository at this point in the history
…me-and-costs

[#43829] Order cost user filter by name
  • Loading branch information
ulferts authored Nov 22, 2024
2 parents 8aaadc4 + 5132825 commit b52d588
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/reporting/app/models/cost_query/filter/user_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ def replace_me_value(value)
def self.available_values(*)
# All users which are members in projects the user can see.
# Excludes the anonymous user
users = User.joins(members: :project)
.merge(Project.visible)
users = User.visible
.human
.ordered_by_name
.select(User::USER_FORMATS_STRUCTURE[Setting.user_format].map(&:to_s) << :id)
.distinct

values = users.map { |u| [u.name, u.id] }
values.unshift [::I18n.t(:label_me), me_value] if User.current.logged?
Expand Down

0 comments on commit b52d588

Please sign in to comment.