summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/notification_recipient.rb6
-rw-r--r--app/services/notification_service.rb2
2 files changed, 2 insertions, 6 deletions
diff --git a/app/models/notification_recipient.rb b/app/models/notification_recipient.rb
index 377ac3febb6..70838138042 100644
--- a/app/models/notification_recipient.rb
+++ b/app/models/notification_recipient.rb
@@ -5,10 +5,6 @@ class NotificationRecipient
attr_reader :user, :type, :reason
def initialize(user, type, **opts)
- unless NotificationSetting.levels.key?(type) || type == :subscription
- raise ArgumentError, "invalid type: #{type.inspect}"
- end
-
@custom_action = opts[:custom_action]
@acting_user = opts[:acting_user]
@target = opts[:target]
@@ -50,7 +46,7 @@ class NotificationRecipient
when :mention
@type == :mention
when :participating
- !excluded_participating_action? && %i[participating mention watch].include?(@type)
+ !excluded_participating_action? && %i[participating mention pipeline].include?(@type)
when :custom
custom_enabled? || %i[participating mention].include?(@type)
when :watch
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 8d3b569498f..1e39d55539c 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -415,7 +415,7 @@ class NotificationService
return unless mailer.respond_to?(email_template)
recipients ||= notifiable_users(
- [pipeline.user], :watch,
+ [pipeline.user], :pipeline,
custom_action: :"#{pipeline.status}_pipeline",
target: pipeline
).map(&:notification_email)