From: Gary Kim Date: Sun, 24 May 2020 23:03:02 +0000 (+0800) Subject: Fix wrong milestone in webhook message (#11596) (#11612) X-Git-Tag: v1.11.6~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a854846f0679766df0d8cc9e3edd3016c3a12f87;p=gitea.git Fix wrong milestone in webhook message (#11596) (#11612) Backport of #11596 Signed-off-by: Gary Kim --- diff --git a/models/issue.go b/models/issue.go index 04b9b3551f..12b08f6d39 100644 --- a/models/issue.go +++ b/models/issue.go @@ -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)