From 432f9dd1a321bedf533f5ce609aeee487eafb526 Mon Sep 17 00:00:00 2001 From: 6543 <24977596+6543@users.noreply.github.com> Date: Tue, 29 Oct 2019 04:11:24 +0100 Subject: [PATCH] [Fix] milestone close timestamp (#8728) (#8730) * BugFix: Update closed_date_unix colum on milestone table on close * go fmt --- models/issue_milestone.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/issue_milestone.go b/models/issue_milestone.go index 1587e5e34..df2f30fb3 100644 --- a/models/issue_milestone.go +++ b/models/issue_milestone.go @@ -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 }