aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-05-09 16:18:44 +0200
committerGitHub <noreply@github.com>2020-05-09 11:18:44 -0300
commitcd4f7ba5bf7191c2ca91438d8903ee9f28f406b9 (patch)
tree5a92b4ff7bc8b719d325bea67da8d0a351794b4a /models
parentb9df5da1f4862d3ed58d528258ea56671791d60d (diff)
downloadgitea-cd4f7ba5bf7191c2ca91438d8903ee9f28f406b9.tar.gz
gitea-cd4f7ba5bf7191c2ca91438d8903ee9f28f406b9.zip
Fix tracked time issues (#11349)
* Fix nil exeption: #11313 * fix 500 * activate test 😆 * move logic
Diffstat (limited to 'models')
-rw-r--r--models/issue_tracked_time.go10
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 {