forked from kevadesu/forgejo
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:
parent
332b2ecd21
commit
06e4687cec
54 changed files with 275 additions and 245 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue