Commit ce7c632f authored by Lin Jen-Shin's avatar Lin Jen-Shin

Introduce EXCLUDED_WATCHER_EVENTS to exclude events

for watchers. Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8176#note_20920905
parent 365cdd8f
...@@ -37,6 +37,10 @@ class NotificationSetting < ActiveRecord::Base ...@@ -37,6 +37,10 @@ class NotificationSetting < ActiveRecord::Base
:success_pipeline :success_pipeline
] ]
EXCLUDED_WATCHER_EVENTS = [
:success_pipeline
]
store :events, accessors: EMAIL_EVENTS, coder: JSON store :events, accessors: EMAIL_EVENTS, coder: JSON
before_create :set_events before_create :set_events
......
...@@ -592,8 +592,7 @@ class NotificationService ...@@ -592,8 +592,7 @@ class NotificationService
recipients = target.participants(current_user) recipients = target.participants(current_user)
# TODO: CLEAN ME UP! unless NotificationSetting::EXCLUDED_WATCHER_EVENTS.include?(custom_action)
unless custom_action == :success_pipeline
recipients = add_project_watchers(recipients, project) recipients = add_project_watchers(recipients, project)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment