aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-04-28 13:48:48 +0200
committerGitHub <noreply@github.com>2022-04-28 13:48:48 +0200
commit06e4687cecaed41500b653e5b8685f48b8b18310 (patch)
treea98dd6d0139ba5d89c7e08d3c52930d66a77119b /models/repo.go
parent332b2ecd214a79b49f3798f4f27fe02b23a17bf8 (diff)
downloadgitea-06e4687cecaed41500b653e5b8685f48b8b18310.tar.gz
gitea-06e4687cecaed41500b653e5b8685f48b8b18310.zip
more context for models (#19511)
make more usage of context, to have more db transaction in one session (make diff of #9307 smaller)
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/repo.go b/models/repo.go
index 5073d1ceb9..9c2fce8d3c 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -57,9 +57,9 @@ func checkRepoUnitUser(ctx context.Context, repo *repo_model.Repository, user *u
if user.IsAdmin {
return true
}
- perm, err := getUserRepoPermission(ctx, repo, user)
+ perm, err := GetUserRepoPermission(ctx, repo, user)
if err != nil {
- log.Error("getUserRepoPermission(): %v", err)
+ log.Error("GetUserRepoPermission(): %v", err)
return false
}
@@ -198,7 +198,7 @@ func GetReviewerTeams(repo *repo_model.Repository) ([]*organization.Team, error)
return nil, nil
}
- teams, err := organization.GetTeamsWithAccessToRepo(repo.OwnerID, repo.ID, perm.AccessModeRead)
+ teams, err := organization.GetTeamsWithAccessToRepo(db.DefaultContext, repo.OwnerID, repo.ID, perm.AccessModeRead)
if err != nil {
return nil, err
}