summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author6543 <24977596+6543@users.noreply.github.com>2019-10-29 03:35:50 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2019-10-29 10:35:50 +0800
commitc4f9d06855ce0faf93b036a5897d85c8b6a2b175 (patch)
tree5b260a909891f41d69ee5db7817f34ff6ec1810b /models
parentc4bc5abda31eed6a367b0b95005c80e97ddb7719 (diff)
downloadgitea-c4f9d06855ce0faf93b036a5897d85c8b6a2b175.tar.gz
gitea-c4f9d06855ce0faf93b036a5897d85c8b6a2b175.zip
[Fix] milestone close timestamp (#8728)
* BugFix: Update closed_date_unix colum on milestone table on close * go fmt
Diffstat (limited to 'models')
-rw-r--r--models/issue_milestone.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/issue_milestone.go b/models/issue_milestone.go
index d32cb3c7d1..a4c2b4b062 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
}