1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-12 20:48:20 +00:00

Fix deleted milestone bug (#1942) (#2300)

* Fix deleted milestone bug

* Use locale for ghost milestone name

* Fix pointer bug
This commit is contained in:
Lunny Xiao
2017-08-14 06:18:57 +08:00
committed by Andrey Nering
parent 1709297701
commit 622552b709
3 changed files with 15 additions and 10 deletions

View File

@@ -596,6 +596,16 @@ func ViewIssue(ctx *context.Context) {
ctx.Handle(500, "LoadMilestone", err)
return
}
ghostMilestone := &models.Milestone{
ID: -1,
Name: ctx.Tr("repo.issues.deleted_milestone"),
}
if comment.OldMilestoneID > 0 && comment.OldMilestone == nil {
comment.OldMilestone = ghostMilestone
}
if comment.MilestoneID > 0 && comment.Milestone == nil {
comment.Milestone = ghostMilestone
}
} else if comment.Type == models.CommentTypeAssignees {
if err = comment.LoadAssignees(); err != nil {
ctx.Handle(500, "LoadAssignees", err)