diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-01-02 05:03:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-01 16:03:31 -0500 |
commit | 8c086bae6e4a041234ba0f0463a392952386cc18 (patch) | |
tree | 602fc82bcb026809e2dc1d1199c88bbecce4b401 | |
parent | 0f99edf123a466ecdea32f97923cbb967b77410d (diff) | |
download | gitea-8c086bae6e4a041234ba0f0463a392952386cc18.tar.gz gitea-8c086bae6e4a041234ba0f0463a392952386cc18.zip |
Fix wrong publisher id (#14212)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
-rw-r--r-- | services/release/release.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/services/release/release.go b/services/release/release.go index 8b4119d252..fd821cc813 100644 --- a/services/release/release.go +++ b/services/release/release.go @@ -63,9 +63,11 @@ func createTag(gitRepo *git.Repository, rel *models.Release) error { return fmt.Errorf("CommitsCount: %v", err) } - u, err := models.GetUserByEmail(commit.Author.Email) - if err == nil { - rel.PublisherID = u.ID + if rel.PublisherID <= 0 { + u, err := models.GetUserByEmail(commit.Author.Email) + if err == nil { + rel.PublisherID = u.ID + } } } else { |