mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Fix tracked time issues (#11349)
* Fix nil exeption: #11313 * fix 500 * activate test 😆 * move logic
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user