1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 09:55:20 +02:00

Use for a repo action one database transaction (#19576)

... more context

(part of #9307)
This commit is contained in:
6543 2022-05-03 21:46:28 +02:00 committed by GitHub
parent 730420b6b3
commit 92f139d091
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 270 additions and 260 deletions

View file

@ -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
}