aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2020-05-24 22:38:34 +0800
committerGitHub <noreply@github.com>2020-05-24 15:38:34 +0100
commit5c55793e0e76e0a878f001ad98a34099983d4cda (patch)
treed34505ad849ca9fdbb9207dd94a4d78b8d79bdb2
parent788b8b1440462d477f45b0088875b66f09da25d4 (diff)
downloadgitea-5c55793e0e76e0a878f001ad98a34099983d4cda.tar.gz
gitea-5c55793e0e76e0a878f001ad98a34099983d4cda.zip
Fix wrong milestone in webhook message (#11596)
Fixes #11295 Signed-off-by: Gary Kim gary@garykim.dev
-rw-r--r--models/issue.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/issue.go b/models/issue.go
index d9f8e929c7..157ad48dee 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -249,7 +249,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)