Introduce EXCLUDED_WATCHER_EVENTS to exclude events
for watchers. Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8176#note_20920905
This commit is contained in:
parent
365cdd8fe0
commit
ce7c632f50
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue