summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2016-11-04 14:19:14 +0000
committerSean McGivern <sean@mcgivern.me.uk>2016-11-04 14:19:14 +0000
commitb2bbac8850a18ccc65880dc5c300d0b6d39ab258 (patch)
tree11987ee4d35a4bd7887c987a0722431db2c802e3 /app/controllers
parenta3cc2f1e8dfcfb2f3e181fa570ed2ba245f9a069 (diff)
parentb7dff1b072204c8c2ad480301b3139e4823c41f4 (diff)
downloadgitlab-ce-b2bbac8850a18ccc65880dc5c300d0b6d39ab258.tar.gz
Merge branch '22588-todos-filter-shows-all-users' into 'master'
Fix: Todos Filter Shows All Users Closes #22588 See merge request !7258
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/autocomplete_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index b48668eea87..daa82336208 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -11,9 +11,13 @@ class AutocompleteController < ApplicationController
@users = @users.reorder(:name)
@users = @users.page(params[:page])
+ if params[:todo_filter].present?
+ @users = @users.todo_authors(current_user.id, params[:todo_state_filter])
+ end
+
if params[:search].blank?
# Include current user if available to filter by "Me"
- if params[:current_user] && current_user
+ if params[:current_user].present? && current_user
@users = [*@users, current_user]
end