Skip to content

Commit

Permalink
[Fix] milestone close timestamp (#8728)
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 lunny committed Oct 29, 2019
1 parent c4bc5ab commit c4f9d06
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 c4f9d06

Please sign in to comment.