diff options
author | Gary Kim <gary@garykim.dev> | 2020-05-25 07:03:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-25 00:03:02 +0100 |
commit | a854846f0679766df0d8cc9e3edd3016c3a12f87 (patch) | |
tree | 2263e4e2b11c2528dc030679e521471995e8c2d9 | |
parent | b52e8de7ded82687a79f31127f05570ac5880de0 (diff) | |
download | gitea-a854846f0679766df0d8cc9e3edd3016c3a12f87.tar.gz gitea-a854846f0679766df0d8cc9e3edd3016c3a12f87.zip |
Fix wrong milestone in webhook message (#11596) (#11612)
Backport of #11596
Signed-off-by: Gary Kim <gary@garykim.dev>
-rw-r--r-- | models/issue.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) |