From 79ee20c746f37a6a1de46e08f5863c14b4d1e38d Mon Sep 17 00:00:00 2001 From: kugan49 Date: Wed, 17 Nov 2021 16:33:00 +0100 Subject: [PATCH] modif watchers diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index 79b8095..f184043 100644 --- a/redmine-4.2.3/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -135,18 +135,13 @@ class WatchersController < ApplicationController def users_for_new_watcher scope = nil if params[:q].blank? && @project.present? - scope = @project.principals.assignable_watchers + scope = @project.users else - scope = Principal.assignable_watchers.limit(100) + scope = User.all.limit(100) end users = scope.sorted.like(params[:q]).to_a if @watchables && @watchables.size == 1 - watchable_object = @watchables.first - users -= watchable_object.watcher_users - - if watchable_object.respond_to?(:visible?) - users.reject! {|user| user.is_a?(User) && !watchable_object.visible?(user)} - end + users -= @watchables.first.watcher_users end users end