Final round of db.DefaultContext refactor (#27587)

Last part of #27065
This commit is contained in:
JakobDev 2023-10-14 10:37:24 +02:00 committed by GitHub
parent ae419fa494
commit 76a85a4ce9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 250 additions and 242 deletions

View file

@ -191,7 +191,7 @@ func AddTime(ctx *context.APIContext) {
return
}
if !ctx.Repo.CanUseTimetracker(issue, ctx.Doer) {
if !ctx.Repo.CanUseTimetracker(ctx, issue, ctx.Doer) {
if !ctx.Repo.Repository.IsTimetrackerEnabled(ctx) {
ctx.Error(http.StatusBadRequest, "", "time tracking disabled")
return
@ -274,7 +274,7 @@ func ResetIssueTime(ctx *context.APIContext) {
return
}
if !ctx.Repo.CanUseTimetracker(issue, ctx.Doer) {
if !ctx.Repo.CanUseTimetracker(ctx, issue, ctx.Doer) {
if !ctx.Repo.Repository.IsTimetrackerEnabled(ctx) {
ctx.JSON(http.StatusBadRequest, struct{ Message string }{Message: "time tracking disabled"})
return
@ -347,7 +347,7 @@ func DeleteTime(ctx *context.APIContext) {
return
}
if !ctx.Repo.CanUseTimetracker(issue, ctx.Doer) {
if !ctx.Repo.CanUseTimetracker(ctx, issue, ctx.Doer) {
if !ctx.Repo.Repository.IsTimetrackerEnabled(ctx) {
ctx.JSON(http.StatusBadRequest, struct{ Message string }{Message: "time tracking disabled"})
return