aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-06 22:48:11 +0800
committerUnknwon <u@gogs.io>2015-08-06 22:48:11 +0800
commit39a3b768bc8b0288cb4aa91d27485f46cfbfeb29 (patch)
treebef625e010018151863344d9da3ff22d2dfbc8f9 /models/issue.go
parent9f12ab0e8847682a686fdb843922a761bbb5c225 (diff)
downloadgitea-39a3b768bc8b0288cb4aa91d27485f46cfbfeb29.tar.gz
gitea-39a3b768bc8b0288cb4aa91d27485f46cfbfeb29.zip
#334: Add Deployment Key Support
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go18
1 files changed, 6 insertions, 12 deletions
diff --git a/models/issue.go b/models/issue.go
index 80afb415bb..a80a984912 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -56,16 +56,11 @@ type Issue struct {
Updated time.Time `xorm:"UPDATED"`
}
-func (i *Issue) BeforeSet(colName string, val xorm.Cell) {
+func (i *Issue) AfterSet(colName string, _ xorm.Cell) {
var err error
switch colName {
case "milestone_id":
- mid := (*val).(int64)
- if mid <= 0 {
- return
- }
-
- i.Milestone, err = GetMilestoneById(mid)
+ i.Milestone, err = GetMilestoneById(i.MilestoneID)
if err != nil {
log.Error(3, "GetMilestoneById: %v", err)
}
@@ -664,15 +659,14 @@ type Milestone struct {
ClosedDate time.Time
}
-func (m *Milestone) BeforeSet(colName string, val xorm.Cell) {
+func (m *Milestone) AfterSet(colName string, _ xorm.Cell) {
if colName == "deadline" {
- t := (*val).(time.Time)
- if t.Year() == 9999 {
+ if m.Deadline.Year() == 9999 {
return
}
- m.DeadlineString = t.Format("2006-01-02")
- if time.Now().After(t) {
+ m.DeadlineString = m.Deadline.Format("2006-01-02")
+ if time.Now().After(m.Deadline) {
m.IsOverDue = true
}
}