]> source.dussan.org Git - gitea.git/commitdiff
Fix wrong milestone in webhook message (#11596) (#11612)
authorGary Kim <gary@garykim.dev>
Sun, 24 May 2020 23:03:02 +0000 (07:03 +0800)
committerGitHub <noreply@github.com>
Sun, 24 May 2020 23:03:02 +0000 (00:03 +0100)
Backport of #11596

Signed-off-by: Gary Kim <gary@garykim.dev>
models/issue.go

index 04b9b3551fcb39a9c54acdbf88c5643b5bd425db..12b08f6d395d2bf8fac02259163fbc79906644eb 100644 (file)
@@ -241,7 +241,7 @@ func (issue *Issue) loadReactions(e Engine) (err error) {
 }
 
 func (issue *Issue) loadMilestone(e Engine) (err error) {
-       if issue.Milestone == nil && issue.MilestoneID > 0 {
+       if (issue.Milestone == nil || issue.Milestone.ID != issue.MilestoneID) && issue.MilestoneID > 0 {
                issue.Milestone, err = getMilestoneByRepoID(e, issue.RepoID, issue.MilestoneID)
                if err != nil && !IsErrMilestoneNotExist(err) {
                        return fmt.Errorf("getMilestoneByRepoID [repo_id: %d, milestone_id: %d]: %v", issue.RepoID, issue.MilestoneID, err)