From 455e367db57fb73525d37e6004ee474ecf5099e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=B8=BF=E9=A3=9E?= Date: Fri, 28 Jul 2023 10:18:46 +0800 Subject: [PATCH] fix(notify): drop event notification default receiver --- pkg/notify/models/notification.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/notify/models/notification.go b/pkg/notify/models/notification.go index 81eee442dc..f6a451dd54 100644 --- a/pkg/notify/models/notification.go +++ b/pkg/notify/models/notification.go @@ -220,7 +220,6 @@ func (nm *SNotificationManager) PerformEventNotify(ctx context.Context, userCred return output, errors.Wrap(err, "unable to get receive") } receiverIds = append(receiverIds, receiverIds1...) - // robot var robots []string _robots, err := SubscriberManager.robot(topic.Id, input.ProjectDomainId, input.ProjectId) @@ -252,7 +251,9 @@ func (nm *SNotificationManager) PerformEventNotify(ctx context.Context, userCred message := jsonutils.Marshal(input.ResourceDetails).String() // append default receiver - receiverIds = append(receiverIds, input.ReceiverIds...) + if len(input.Event) == 0 { + receiverIds = append(receiverIds, input.ReceiverIds...) + } // fillter non-existed receiver receivers, err := ReceiverManager.FetchByIdOrNames(ctx, receiverIds...) if err != nil {