From 92f139d091c906cc6d30599101d45c62a208f585 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 3 May 2022 21:46:28 +0200 Subject: Use for a repo action one database transaction (#19576) ... more context (part of #9307) --- models/repo_permission.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'models/repo_permission.go') diff --git a/models/repo_permission.go b/models/repo_permission.go index bc31b873f2..8ba6b86145 100644 --- a/models/repo_permission.go +++ b/models/repo_permission.go @@ -331,10 +331,11 @@ func IsUserRealRepoAdmin(repo *repo_model.Repository, user *user_model.User) (bo // IsUserRepoAdmin return true if user has admin right of a repo func IsUserRepoAdmin(repo *repo_model.Repository, user *user_model.User) (bool, error) { - return isUserRepoAdmin(db.DefaultContext, repo, user) + return IsUserRepoAdminCtx(db.DefaultContext, repo, user) } -func isUserRepoAdmin(ctx context.Context, repo *repo_model.Repository, user *user_model.User) (bool, error) { +// IsUserRepoAdminCtx return true if user has admin right of a repo +func IsUserRepoAdminCtx(ctx context.Context, repo *repo_model.Repository, user *user_model.User) (bool, error) { if user == nil || repo == nil { return false, nil } -- cgit v1.2.3