summaryrefslogtreecommitdiff
path: root/app/models/notification_recipient.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 18:09:21 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 18:09:21 +0000
commite0fa0638a422c3e20d4423c9bb69d79afc9c7d3d (patch)
tree9abb3c0706576bbda895fe9539a55556930606e2 /app/models/notification_recipient.rb
parentf8d15ca65390475e356b06dedc51e10ccd179f86 (diff)
downloadgitlab-ce-e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/notification_recipient.rb')
-rw-r--r--app/models/notification_recipient.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/notification_recipient.rb b/app/models/notification_recipient.rb
index 8e44e3d8e17..107d00d055a 100644
--- a/app/models/notification_recipient.rb
+++ b/app/models/notification_recipient.rb
@@ -52,7 +52,8 @@ class NotificationRecipient
when :mention
@type == :mention
when :participating
- @custom_action == :failed_pipeline || %i[participating mention].include?(@type)
+ %i[failed_pipeline fixed_pipeline].include?(@custom_action) ||
+ %i[participating mention].include?(@type)
when :custom
custom_enabled? || %i[participating mention].include?(@type)
when :watch
@@ -63,7 +64,13 @@ class NotificationRecipient
end
def custom_enabled?
- @custom_action && notification_setting&.event_enabled?(@custom_action)
+ return false unless @custom_action
+ return false unless notification_setting
+
+ notification_setting.event_enabled?(@custom_action) ||
+ # fixed_pipeline is a subset of success_pipeline event
+ (@custom_action == :fixed_pipeline &&
+ notification_setting.event_enabled?(:success_pipeline))
end
def unsubscribed?