diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/issue_tracked_time.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/models/issue_tracked_time.go b/models/issue_tracked_time.go index 49fefd3279..195f3e7850 100644 --- a/models/issue_tracked_time.go +++ b/models/issue_tracked_time.go @@ -260,6 +260,10 @@ func DeleteTime(t *TrackedTime) error { return err } + if err := t.loadAttributes(sess); err != nil { + return err + } + if err := deleteTime(sess, t); err != nil { return err } @@ -299,10 +303,8 @@ func deleteTime(e Engine, t *TrackedTime) error { // GetTrackedTimeByID returns raw TrackedTime without loading attributes by id func GetTrackedTimeByID(id int64) (*TrackedTime, error) { - time := &TrackedTime{ - ID: id, - } - has, err := x.Get(time) + time := new(TrackedTime) + has, err := x.ID(id).Get(time) if err != nil { return nil, err } else if !has { |