diff options
Diffstat (limited to 'routers/api/v1/repo/issue_tracked_time.go')
-rw-r--r-- | routers/api/v1/repo/issue_tracked_time.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go index 8ccad87838..19e1a82590 100644 --- a/routers/api/v1/repo/issue_tracked_time.go +++ b/routers/api/v1/repo/issue_tracked_time.go @@ -94,7 +94,7 @@ func ListTrackedTimes(ctx *context.APIContext) { qUser := ctx.FormTrim("user") if qUser != "" { - user, err := user_model.GetUserByName(qUser) + user, err := user_model.GetUserByName(ctx, qUser) if user_model.IsErrUserNotExist(err) { ctx.Error(http.StatusNotFound, "User does not exist", err) } else if err != nil { @@ -128,7 +128,7 @@ func ListTrackedTimes(ctx *context.APIContext) { return } - trackedTimes, err := models.GetTrackedTimes(opts) + trackedTimes, err := models.GetTrackedTimes(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "GetTrackedTimes", err) return @@ -203,7 +203,7 @@ func AddTime(ctx *context.APIContext) { if form.User != "" { if (ctx.IsUserRepoAdmin() && ctx.Doer.Name != form.User) || ctx.Doer.IsAdmin { // allow only RepoAdmin, Admin and User to add time - user, err = user_model.GetUserByName(form.User) + user, err = user_model.GetUserByName(ctx, form.User) if err != nil { ctx.Error(http.StatusInternalServerError, "GetUserByName", err) } @@ -415,7 +415,7 @@ func ListTrackedTimesByUser(ctx *context.APIContext) { ctx.Error(http.StatusBadRequest, "", "time tracking disabled") return } - user, err := user_model.GetUserByName(ctx.Params(":timetrackingusername")) + user, err := user_model.GetUserByName(ctx, ctx.Params(":timetrackingusername")) if err != nil { if user_model.IsErrUserNotExist(err) { ctx.NotFound(err) @@ -439,7 +439,7 @@ func ListTrackedTimesByUser(ctx *context.APIContext) { RepositoryID: ctx.Repo.Repository.ID, } - trackedTimes, err := models.GetTrackedTimes(opts) + trackedTimes, err := models.GetTrackedTimes(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "GetTrackedTimes", err) return @@ -512,7 +512,7 @@ func ListTrackedTimesByRepository(ctx *context.APIContext) { // Filters qUser := ctx.FormTrim("user") if qUser != "" { - user, err := user_model.GetUserByName(qUser) + user, err := user_model.GetUserByName(ctx, qUser) if user_model.IsErrUserNotExist(err) { ctx.Error(http.StatusNotFound, "User does not exist", err) } else if err != nil { @@ -547,7 +547,7 @@ func ListTrackedTimesByRepository(ctx *context.APIContext) { return } - trackedTimes, err := models.GetTrackedTimes(opts) + trackedTimes, err := models.GetTrackedTimes(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "GetTrackedTimes", err) return @@ -609,7 +609,7 @@ func ListMyTrackedTimes(ctx *context.APIContext) { return } - trackedTimes, err := models.GetTrackedTimes(opts) + trackedTimes, err := models.GetTrackedTimes(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "GetTrackedTimesByUser", err) return |