From 018adf956e231d23470aa98f04153fd658bb5741 Mon Sep 17 00:00:00 2001 From: Oleh Fedorenko Date: Tue, 20 Jun 2023 18:39:06 +0000 Subject: [PATCH] Refs #36351 - Fix wrong subject --- app/lib/actions/check_long_running_tasks.rb | 2 +- app/lib/actions/deliver_long_running_tasks_notification.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/actions/check_long_running_tasks.rb b/app/lib/actions/check_long_running_tasks.rb index f73cd5b5d..06c4724ec 100644 --- a/app/lib/actions/check_long_running_tasks.rb +++ b/app/lib/actions/check_long_running_tasks.rb @@ -11,7 +11,7 @@ def plan notification = ::ForemanTasks::TasksMailNotification.find_by(name: "long_running_tasks") org_admin_role = Role.find_by(name: 'Organization admin') users = User.left_joins(:roles) - .where(id: UserMailNotification.where(mail_notification_id: notification.id).select(:host_id)) + .where(id: UserMailNotification.where(mail_notification_id: notification.id).select(:role_id)) .or(User.where(admin: true)) .or(User.where(id: UserRole.where(id: [org_admin_role.id] + org_admin_role.cloned_role_ids).select(:owner_id))) diff --git a/app/lib/actions/deliver_long_running_tasks_notification.rb b/app/lib/actions/deliver_long_running_tasks_notification.rb index 6116785bf..ebe1e5e37 100644 --- a/app/lib/actions/deliver_long_running_tasks_notification.rb +++ b/app/lib/actions/deliver_long_running_tasks_notification.rb @@ -11,7 +11,7 @@ def run tasks = ForemanTasks::Task.where(id: report.task_uuids) report.user = User.current report.tasks = tasks - ::UINotifications::Tasks::TasksRunningLong.new.deliver! + ::UINotifications::Tasks::TasksRunningLong.new(report).deliver! TasksMailer.long_tasks(report).deliver_now end