From 4f386fea1a33811f7f85292fe06662e93906f4eb Mon Sep 17 00:00:00 2001 From: rainzm Date: Wed, 23 Dec 2020 17:46:48 +0800 Subject: [PATCH] fix(notify): fit correctly when send notification via contact --- pkg/notify/models/notification.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/notify/models/notification.go b/pkg/notify/models/notification.go index f9a73ee243..f9bb51c15e 100644 --- a/pkg/notify/models/notification.go +++ b/pkg/notify/models/notification.go @@ -78,7 +78,7 @@ const ( func (nm *SNotificationManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.NotificationCreateInput) (api.NotificationCreateInput, error) { // compatible - if len(input.Receivers) == 0 && input.ContactType == api.WEBCONSOLE { + if len(input.Receivers) != 0 && input.ContactType == api.WEBCONSOLE { input.Contacts = input.Receivers input.Receivers = []string{} }