mirror of
https://github.com/go-gitea/gitea
synced 2025-09-28 03:28:13 +00:00
more context for models (#19511)
make more usage of context, to have more db transaction in one session (make diff of #9307 smaller)
This commit is contained in:
@@ -238,7 +238,7 @@ func isOfficialReviewer(ctx context.Context, issue *Issue, reviewers ...*user_mo
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if err = pr.loadProtectedBranch(ctx); err != nil {
|
||||
if err = pr.LoadProtectedBranchCtx(ctx); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if pr.ProtectedBranch == nil {
|
||||
@@ -265,7 +265,7 @@ func isOfficialReviewerTeam(ctx context.Context, issue *Issue, team *organizatio
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if err = pr.loadProtectedBranch(ctx); err != nil {
|
||||
if err = pr.LoadProtectedBranchCtx(ctx); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if pr.ProtectedBranch == nil {
|
||||
@@ -891,7 +891,7 @@ func CanMarkConversation(issue *Issue, doer *user_model.User) (permResult bool,
|
||||
return false, err
|
||||
}
|
||||
|
||||
p, err := GetUserRepoPermission(issue.Repo, doer)
|
||||
p, err := GetUserRepoPermission(db.DefaultContext, issue.Repo, doer)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user