summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-09 07:42:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-09 07:42:52 +0000
commit14234eae3948fefddce58cda76c94841f836fb08 (patch)
treefd7d93206e4a1320012464f996e48492f3f445a8
parent9c2545e28d074287d9ea987ba254e8c486f26afd (diff)
downloadredmine-14234eae3948fefddce58cda76c94841f836fb08.tar.gz
redmine-14234eae3948fefddce58cda76c94841f836fb08.zip
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
-rw-r--r--app/controllers/watchers_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index 37c03cdaa..488898546 100644
--- a/app/controllers/watchers_controller.rb
+++ b/app/controllers/watchers_controller.rb
@@ -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