1
0
Fork 0
forked from forgejo/forgejo

Next round of db.DefaultContext refactor (#27089)

Part of #27065
This commit is contained in:
JakobDev 2023-09-16 16:39:12 +02:00 committed by GitHub
parent a1b2a11812
commit f91dbbba98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 434 additions and 464 deletions

View file

@ -1412,7 +1412,7 @@ func ViewIssue(ctx *context.Context) {
if ctx.Doer != nil {
iw.UserID = ctx.Doer.ID
iw.IssueID = issue.ID
iw.IsWatching, err = issues_model.CheckIssueWatch(ctx.Doer, issue)
iw.IsWatching, err = issues_model.CheckIssueWatch(ctx, ctx.Doer, issue)
if err != nil {
ctx.ServerError("CheckIssueWatch", err)
return
@ -1530,7 +1530,7 @@ func ViewIssue(ctx *context.Context) {
if ctx.Repo.Repository.IsTimetrackerEnabled(ctx) {
if ctx.IsSigned {
// Deal with the stopwatch
ctx.Data["IsStopwatchRunning"] = issues_model.StopwatchExists(ctx.Doer.ID, issue.ID)
ctx.Data["IsStopwatchRunning"] = issues_model.StopwatchExists(ctx, ctx.Doer.ID, issue.ID)
if !ctx.Data["IsStopwatchRunning"].(bool) {
var exists bool
var swIssue *issues_model.Issue
@ -2708,7 +2708,7 @@ func ListIssues(ctx *context.Context) {
var labelIDs []int64
if splitted := strings.Split(ctx.FormString("labels"), ","); len(splitted) > 0 {
labelIDs, err = issues_model.GetLabelIDsInRepoByNames(ctx.Repo.Repository.ID, splitted)
labelIDs, err = issues_model.GetLabelIDsInRepoByNames(ctx, ctx.Repo.Repository.ID, splitted)
if err != nil {
ctx.Error(http.StatusInternalServerError, err.Error())
return
@ -2720,7 +2720,7 @@ func ListIssues(ctx *context.Context) {
for i := range part {
// uses names and fall back to ids
// non existent milestones are discarded
mile, err := issues_model.GetMilestoneByRepoIDANDName(ctx.Repo.Repository.ID, part[i])
mile, err := issues_model.GetMilestoneByRepoIDANDName(ctx, ctx.Repo.Repository.ID, part[i])
if err == nil {
mileIDs = append(mileIDs, mile.ID)
continue
@ -3037,7 +3037,7 @@ func NewComment(ctx *context.Context) {
return
}
} else {
if err := stopTimerIfAvailable(ctx.Doer, issue); err != nil {
if err := stopTimerIfAvailable(ctx, ctx.Doer, issue); err != nil {
ctx.ServerError("CreateOrStopIssueStopwatch", err)
return
}