1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-20 15:31:12 +00:00

Don't reject users that already watch one of the objects (#5754).

git-svn-id: http://svn.redmine.org/redmine/trunk@15313 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2016-04-09 07:42:52 +00:00
parent 9c2545e28d
commit 14234eae39

View File

@ -121,8 +121,8 @@ class WatchersController < ApplicationController
scope = User.all.limit(100)
end
users = scope.active.visible.sorted.like(params[:q]).to_a
if @watchables
users -= @watchables.map(&:watcher_users).flatten
if @watchables && @watchables.size == 1
users -= @watchables.first.watcher_users
end
users
end