aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue_comment.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-06-17 00:51:28 -0400
committerLunny Xiao <xiaolunwen@gmail.com>2017-06-17 12:51:28 +0800
commit8fc64741d95aa31665e4238fd7e20396a4cdf813 (patch)
tree613e6ec6f9d14e939e70345b18e4d115df7862e8 /models/issue_comment.go
parentce9b86082c4824917023b1bb480648d0cc56dd04 (diff)
downloadgitea-8fc64741d95aa31665e4238fd7e20396a4cdf813.tar.gz
gitea-8fc64741d95aa31665e4238fd7e20396a4cdf813.zip
Fix deleted milestone bug (#1942)
* Fix deleted milestone bug * Use locale for ghost milestone name * Fix pointer bug
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r--models/issue_comment.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go
index 69edf28f54..91d8551518 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -231,12 +231,9 @@ func (c *Comment) LoadMilestone() error {
has, err := x.ID(c.OldMilestoneID).Get(&oldMilestone)
if err != nil {
return err
- } else if !has {
- return ErrMilestoneNotExist{
- ID: c.OldMilestoneID,
- }
+ } else if has {
+ c.OldMilestone = &oldMilestone
}
- c.OldMilestone = &oldMilestone
}
if c.MilestoneID > 0 {
@@ -244,12 +241,9 @@ func (c *Comment) LoadMilestone() error {
has, err := x.ID(c.MilestoneID).Get(&milestone)
if err != nil {
return err
- } else if !has {
- return ErrMilestoneNotExist{
- ID: c.MilestoneID,
- }
+ } else if has {
+ c.Milestone = &milestone
}
- c.Milestone = &milestone
}
return nil
}