diff options
author | JakobDev <jakobdev@gmx.de> | 2023-09-29 14:12:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 12:12:54 +0000 |
commit | cf0df023be06c8acec4fc8fb05eab1d1c2e52fd1 (patch) | |
tree | 4fd233354202942b597f3591a22e5ea14fe7d0eb /services/pull | |
parent | 3945c26722dececf2433107c47821238dae7e3c2 (diff) | |
download | gitea-cf0df023be06c8acec4fc8fb05eab1d1c2e52fd1.tar.gz gitea-cf0df023be06c8acec4fc8fb05eab1d1c2e52fd1.zip |
More `db.DefaultContext` refactor (#27265)
Part of #27065
This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.
Diffstat (limited to 'services/pull')
-rw-r--r-- | services/pull/pull.go | 4 | ||||
-rw-r--r-- | services/pull/review.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/services/pull/pull.go b/services/pull/pull.go index 8e57aebe3d..5e76fac815 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -336,7 +336,7 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string, } if changed { // Mark old reviews as stale if diff to mergebase has changed - if err := issues_model.MarkReviewsAsStale(pr.IssueID); err != nil { + if err := issues_model.MarkReviewsAsStale(ctx, pr.IssueID); err != nil { log.Error("MarkReviewsAsStale: %v", err) } @@ -351,7 +351,7 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string, } } } - if err := issues_model.MarkReviewsAsNotStale(pr.IssueID, newCommitID); err != nil { + if err := issues_model.MarkReviewsAsNotStale(ctx, pr.IssueID, newCommitID); err != nil { log.Error("MarkReviewsAsNotStale: %v", err) } divergence, err := GetDiverging(ctx, pr) diff --git a/services/pull/review.go b/services/pull/review.go index c82d1341b6..64eea22eec 100644 --- a/services/pull/review.go +++ b/services/pull/review.go @@ -84,7 +84,7 @@ func CreateCodeComment(ctx context.Context, doer *user_model.User, gitRepo *git. if !pendingReview && replyReviewID != 0 { // It's not part of a review; maybe a reply to a review comment or a single comment. // Check if there are reviews for that line already; if there are, this is a reply - if existsReview, err = issues_model.ReviewExists(issue, treePath, line); err != nil { + if existsReview, err = issues_model.ReviewExists(ctx, issue, treePath, line); err != nil { return nil, err } } @@ -288,7 +288,7 @@ func SubmitReview(ctx context.Context, doer *user_model.User, gitRepo *git.Repos } } - review, comm, err := issues_model.SubmitReview(doer, issue, reviewType, content, commitID, stale, attachmentUUIDs) + review, comm, err := issues_model.SubmitReview(ctx, doer, issue, reviewType, content, commitID, stale, attachmentUUIDs) if err != nil { return nil, nil, err } |