summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/notification_setting.rb4
-rw-r--r--app/services/notification_service.rb3
2 files changed, 5 insertions, 2 deletions
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb
index 43fc218de2b..58f6214bea7 100644
--- a/app/models/notification_setting.rb
+++ b/app/models/notification_setting.rb
@@ -37,6 +37,10 @@ class NotificationSetting < ActiveRecord::Base
:success_pipeline
]
+ EXCLUDED_WATCHER_EVENTS = [
+ :success_pipeline
+ ]
+
store :events, accessors: EMAIL_EVENTS, coder: JSON
before_create :set_events
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 75277d3ac12..c3b61e68eab 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -592,8 +592,7 @@ class NotificationService
recipients = target.participants(current_user)
- # TODO: CLEAN ME UP!
- unless custom_action == :success_pipeline
+ unless NotificationSetting::EXCLUDED_WATCHER_EVENTS.include?(custom_action)
recipients = add_project_watchers(recipients, project)
end