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>
This commit is contained in:
Lunny Xiao 2021-01-02 05:03:31 +08:00 committed by GitHub
parent 0f99edf123
commit 8c086bae6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,9 +63,11 @@ func createTag(gitRepo *git.Repository, rel *models.Release) error {
return fmt.Errorf("CommitsCount: %v", err) return fmt.Errorf("CommitsCount: %v", err)
} }
u, err := models.GetUserByEmail(commit.Author.Email) if rel.PublisherID <= 0 {
if err == nil { u, err := models.GetUserByEmail(commit.Author.Email)
rel.PublisherID = u.ID if err == nil {
rel.PublisherID = u.ID
}
} }
} else { } else {