Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

avoid unnecessary db call

ulferts780afef282e7
diff --git a/app/workers/notifications/create_date_alerts_notifications_job/service.rb b/app/workers/notifications/create_date_alerts_notifications_job/service.rb
index ae5b360b7cb..f55c156c660 100644
--- a/app/workers/notifications/create_date_alerts_notifications_job/service.rb
+++ b/app/workers/notifications/create_date_alerts_notifications_job/service.rb
@@ -57,6 +57,8 @@ class Notifications::CreateDateAlertsNotificationsJob::Service
end
def mark_previous_notifications_as_read(user, work_packages, reason)
+ return if work_packages.empty?
+
Notification
.where(recipient: user,
reason:,