From ebe803e514acb4eedc884226be2489ee6b4acd28 Mon Sep 17 00:00:00 2001 From: JakobDev Date: Wed, 11 Oct 2023 06:24:07 +0200 Subject: Penultimate round of `db.DefaultContext` refactor (#27414) Part of #27065 --------- Co-authored-by: Lunny Xiao --- modules/context/repo.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/context') diff --git a/modules/context/repo.go b/modules/context/repo.go index 18b6650b6e..b340a6e230 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -495,7 +495,7 @@ func RepoAssignment(ctx *Context) context.CancelFunc { } // Get repository. - repo, err := repo_model.GetRepositoryByName(owner.ID, repoName) + repo, err := repo_model.GetRepositoryByName(ctx, owner.ID, repoName) if err != nil { if repo_model.IsErrRepoNotExist(err) { redirectRepoID, err := repo_model.LookupRedirect(owner.ID, repoName) @@ -711,13 +711,13 @@ func RepoAssignment(ctx *Context) context.CancelFunc { // Pull request is allowed if this is a fork repository // and base repository accepts pull requests. - if repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls() { + if repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls(ctx) { canCompare = true ctx.Data["BaseRepo"] = repo.BaseRepo ctx.Repo.PullRequest.BaseRepo = repo.BaseRepo ctx.Repo.PullRequest.Allowed = canPush ctx.Repo.PullRequest.HeadInfoSubURL = url.PathEscape(ctx.Repo.Owner.Name) + ":" + util.PathEscapeSegments(ctx.Repo.BranchName) - } else if repo.AllowsPulls() { + } else if repo.AllowsPulls(ctx) { // Or, this is repository accepts pull requests between branches. canCompare = true ctx.Data["BaseRepo"] = repo -- cgit v1.2.3