summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo
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 /routers/api/v1/repo
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 'routers/api/v1/repo')
-rw-r--r--routers/api/v1/repo/issue_tracked_time.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go
index 66f8a0879a..19242d1fae 100644
--- a/routers/api/v1/repo/issue_tracked_time.go
+++ b/routers/api/v1/repo/issue_tracked_time.go
@@ -324,6 +324,10 @@ func DeleteTime(ctx *context.APIContext) {
ctx.Error(http.StatusInternalServerError, "GetTrackedTimeByID", err)
return
}
+ if time.Deleted {
+ ctx.NotFound(fmt.Errorf("tracked time [%d] already deleted", time.ID))
+ return
+ }
if !ctx.User.IsAdmin && time.UserID != ctx.User.ID {
//Only Admin and User itself can delete their time