Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-11-17 14:13:39 +0300
committerPhil Hughes <me@iamphill.com>2016-11-17 14:13:39 +0300
commit80073da95771fc51a4ac05814b0a7ceae1cbdac9 (patch)
tree09f2dc8652e1913ae84ccbd1add05d837fce5c2a /app/controllers/autocomplete_controller.rb
parentcfcf5460b55c8f6245dd59e4531cd4b3b7abf114 (diff)
Include author in assignee dropdown search
When searching for the author in the assignee dropdown it now correctly returns the user Closes #22905
Diffstat (limited to 'app/controllers/autocomplete_controller.rb')
-rw-r--r--app/controllers/autocomplete_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index daa82336208..fcfa508128e 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -55,7 +55,13 @@ class AutocompleteController < ApplicationController
def find_users
@users =
if @project
- @project.team.users
+ user_ids = @project.team.users.map(&:id)
+
+ if params[:author_id].present?
+ user_ids << params[:author_id]
+ end
+
+ User.where(id: user_ids)
elsif params[:group_id].present?
group = Group.find(params[:group_id])
return render_404 unless can?(current_user, :read_group, group)