]> source.dussan.org Git - gitea.git/commitdiff
[Fix] milestone close timestamp (#8728)
author6543 <24977596+6543@users.noreply.github.com>
Tue, 29 Oct 2019 02:35:50 +0000 (03:35 +0100)
committerLunny Xiao <xiaolunwen@gmail.com>
Tue, 29 Oct 2019 02:35:50 +0000 (10:35 +0800)
* BugFix: Update closed_date_unix colum on milestone table on close

* go fmt

models/issue_milestone.go

index d32cb3c7d1f4abdfa8bc49c7e753c2965535c3b3..a4c2b4b0622c7c1e7d6aa7c1223652e7a9a0e60b 100644 (file)
@@ -306,7 +306,11 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) {
        }
 
        m.IsClosed = isClosed
-       if _, err := sess.ID(m.ID).Cols("is_closed").Update(m); err != nil {
+       if isClosed {
+               m.ClosedDateUnix = timeutil.TimeStampNow()
+       }
+
+       if _, err := sess.ID(m.ID).Cols("is_closed", "closed_date_unix").Update(m); err != nil {
                return err
        }