Commit 3b42c267a6299b7aeed8c3309dae49b5b7b3f9e0
1 parent
07a88d66
Exists in
master
and in
4 other branches
Dont show blocked users in autocomplete
Showing
2 changed files
with
2 additions
and
0 deletions
Show diff stats
app/assets/javascripts/users_select.js.coffee
@@ -24,6 +24,7 @@ $ -> | @@ -24,6 +24,7 @@ $ -> | ||
24 | data: (term, page) -> | 24 | data: (term, page) -> |
25 | search: term # search term | 25 | search: term # search term |
26 | per_page: 10 | 26 | per_page: 10 |
27 | + active: true | ||
27 | private_token: gon.api_token | 28 | private_token: gon.api_token |
28 | 29 | ||
29 | results: (data, page) -> # parse the results into the format expected by Select2. | 30 | results: (data, page) -> # parse the results into the format expected by Select2. |
lib/api/users.rb
@@ -10,6 +10,7 @@ module Gitlab | @@ -10,6 +10,7 @@ module Gitlab | ||
10 | # GET /users | 10 | # GET /users |
11 | get do | 11 | get do |
12 | @users = User.scoped | 12 | @users = User.scoped |
13 | + @users = @users.active if params[:active].present? | ||
13 | @users = @users.search(params[:search]) if params[:search].present? | 14 | @users = @users.search(params[:search]) if params[:search].present? |
14 | present @users, with: Entities::User | 15 | present @users, with: Entities::User |
15 | end | 16 | end |