diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-10-17 23:33:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 17:33:27 -0400 |
commit | a37e8b275d19c0daf160cc540d981ec4f3025a5a (patch) | |
tree | 2ea250b31a5fe903dd02cf481c8fd10d8a4d7b9b | |
parent | c0888def506f0ca74d3499bb6941a8743f6a5206 (diff) | |
download | gitea-a37e8b275d19c0daf160cc540d981ec4f3025a5a.tar.gz gitea-a37e8b275d19c0daf160cc540d981ec4f3025a5a.zip |
Do not send notifications for draft releases (#21451)
Fixes #21448
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
-rw-r--r-- | services/release/release.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/services/release/release.go b/services/release/release.go index 187ebeb486..af1b075232 100644 --- a/services/release/release.go +++ b/services/release/release.go @@ -271,13 +271,12 @@ func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_mod } } - if !isCreated { - notification.NotifyUpdateRelease(doer, rel) - return - } - if !rel.IsDraft { - notification.NotifyNewRelease(rel) + if isCreated { + notification.NotifyNewRelease(rel) + } else { + notification.NotifyUpdateRelease(doer, rel) + } } return err @@ -353,7 +352,9 @@ func DeleteReleaseByID(ctx context.Context, id int64, doer *user_model.User, del } } - notification.NotifyDeleteRelease(doer, rel) + if !rel.IsDraft { + notification.NotifyDeleteRelease(doer, rel) + } return nil } |