mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 09:52:26 +02: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:
parent
332b2ecd21
commit
06e4687cec
54 changed files with 275 additions and 245 deletions
|
@ -498,7 +498,7 @@ func CreateBranchProtection(ctx *context.APIContext) {
|
|||
BlockOnOutdatedBranch: form.BlockOnOutdatedBranch,
|
||||
}
|
||||
|
||||
err = models.UpdateProtectBranch(ctx.Repo.Repository, protectBranch, models.WhitelistOptions{
|
||||
err = models.UpdateProtectBranch(ctx, ctx.Repo.Repository, protectBranch, models.WhitelistOptions{
|
||||
UserIDs: whitelistUsers,
|
||||
TeamIDs: whitelistTeams,
|
||||
MergeUserIDs: mergeWhitelistUsers,
|
||||
|
@ -733,7 +733,7 @@ func EditBranchProtection(ctx *context.APIContext) {
|
|||
}
|
||||
}
|
||||
|
||||
err = models.UpdateProtectBranch(ctx.Repo.Repository, protectBranch, models.WhitelistOptions{
|
||||
err = models.UpdateProtectBranch(ctx, ctx.Repo.Repository, protectBranch, models.WhitelistOptions{
|
||||
UserIDs: whitelistUsers,
|
||||
TeamIDs: whitelistTeams,
|
||||
MergeUserIDs: mergeWhitelistUsers,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue