Commit f2111f6c authored by Sean McGivern's avatar Sean McGivern
Browse files

Merge branch 'simplify-pipeline-notification-check' into 'master'

Simplify notification check for participating

See merge request gitlab-org/gitlab-ce!29188
......@@ -50,7 +50,7 @@ def suitable_notification_level?
when :mention
@type == :mention
when :participating
!excluded_participating_action? && %i[participating mention watch].include?(@type)
@custom_action == :failed_pipeline || %i[participating mention].include?(@type)
when :custom
custom_enabled? || %i[participating mention].include?(@type)
when :watch
......@@ -106,12 +106,6 @@ def excluded_watcher_action?
NotificationSetting::EXCLUDED_WATCHER_EVENTS.include?(@custom_action)
end
def excluded_participating_action?
return false unless @custom_action
NotificationSetting::EXCLUDED_PARTICIPATING_EVENTS.include?(@custom_action)
end
private
def read_ability
......
......@@ -54,14 +54,11 @@ def email_events
self.class.email_events(source)
end
EXCLUDED_PARTICIPATING_EVENTS = [
:success_pipeline
].freeze
EXCLUDED_WATCHER_EVENTS = [
:push_to_merge_request,
:issue_due
].push(*EXCLUDED_PARTICIPATING_EVENTS).freeze
:issue_due,
:success_pipeline
].freeze
def self.find_or_create_for(source)
setting = find_or_initialize_by(source: source)
......
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