From 61b9772096506065b44e40d92de9f2452dee3859 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 17 Oct 2022 23:33:27 +0200 Subject: [PATCH] Revert "Do not send notifications for draft releases (#21451)" This reverts commit a37e8b275d19c0daf160cc540d981ec4f3025a5a. --- services/release/release.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/services/release/release.go b/services/release/release.go index 346c2abd421b6..8ccc222fb261a 100644 --- a/services/release/release.go +++ b/services/release/release.go @@ -271,12 +271,13 @@ func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_mod } } + if !isCreated { + notification.NotifyUpdateRelease(doer, rel) + return + } + if !rel.IsDraft { - if isCreated { - notification.NotifyNewRelease(rel) - } else { - notification.NotifyUpdateRelease(doer, rel) - } + notification.NotifyNewRelease(rel) } return err @@ -352,9 +353,7 @@ func DeleteReleaseByID(ctx context.Context, id int64, doer *user_model.User, del } } - if !rel.IsDraft { - notification.NotifyDeleteRelease(doer, rel) - } + notification.NotifyDeleteRelease(doer, rel) return nil }