Fix due date reminder spam for locked tasks [SCI-9885]

This commit is contained in:
Martin Artnik 2023-12-13 13:30:23 +01:00
parent b38fe27e63
commit 788f01aeae
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@
module MyModules module MyModules
class DueDateReminderJob < ApplicationJob class DueDateReminderJob < ApplicationJob
def perform def perform
my_modules = MyModule.approaching_due_dates my_modules = MyModule.uncomplete.approaching_due_dates
my_modules.each do |task| my_modules.each do |task|
TaskDueDateNotification.send_notifications({ my_module_id: task.id }) TaskDueDateNotification.send_notifications({ my_module_id: task.id })

View file

@ -17,6 +17,6 @@ class TaskDueDateNotification < BaseNotification
end end
after_deliver do after_deliver do
MyModule.find(params[:my_module_id]).update(due_date_notification_sent: true) MyModule.find(params[:my_module_id]).update_column(:due_date_notification_sent, true)
end end
end end