Skip to content

Commit

Permalink
[Fix] milestone close timestamp (#8728) (#8730)
Browse files Browse the repository at this point in the history
* BugFix: Update closed_date_unix colum on milestone table on close

* go fmt
  • Loading branch information
6543 authored and zeripath committed Oct 29, 2019
1 parent 8caf059 commit 432f9dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion models/issue_milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 432f9dd

Please sign in to comment.