diff --git a/src/api/app/controllers/webui/request_controller.rb b/src/api/app/controllers/webui/request_controller.rb index 626c850628d..7bec5e71102 100644 --- a/src/api/app/controllers/webui/request_controller.rb +++ b/src/api/app/controllers/webui/request_controller.rb @@ -352,9 +352,9 @@ def addreview_opts end def any_project_maintained_by_current_user? - projects = @actions.select(:target_project).distinct.pluck(:target_project) + projects = Project.where(name: @actions.select(:target_project)) maintainer_role = Role.find_by_title('maintainer') - projects.any? { |project| Project.find_by_name(project).user_has_role?(User.possibly_nobody, maintainer_role) } + projects.any? { |project| project.user_has_role?(User.possibly_nobody, maintainer_role) } end def new_state