aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-05-03 21:46:28 +0200
committerGitHub <noreply@github.com>2022-05-03 21:46:28 +0200
commit92f139d091c906cc6d30599101d45c62a208f585 (patch)
treee7be0dfc3cd9ae0611bd7cfa11cc1ee277e756fd /models/repo.go
parent730420b6b32414db7fcd12ede87712b0f960de7b (diff)
downloadgitea-92f139d091c906cc6d30599101d45c62a208f585.tar.gz
gitea-92f139d091c906cc6d30599101d45c62a208f585.zip
Use for a repo action one database transaction (#19576)
... more context (part of #9307)
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 9c2fce8d3c..e934b24fb3 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -455,8 +455,8 @@ func CreateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_
}
}
- if isAdmin, err := isUserRepoAdmin(ctx, repo, doer); err != nil {
- return fmt.Errorf("isUserRepoAdmin: %v", err)
+ if isAdmin, err := IsUserRepoAdminCtx(ctx, repo, doer); err != nil {
+ return fmt.Errorf("IsUserRepoAdminCtx: %v", err)
} else if !isAdmin {
// Make creator repo admin if it wasn't assigned automatically
if err = addCollaborator(ctx, repo, doer); err != nil {
@@ -1215,7 +1215,7 @@ func DeleteDeployKey(ctx context.Context, doer *user_model.User, id int64) error
if err != nil {
return fmt.Errorf("GetRepositoryByID: %v", err)
}
- has, err := isUserRepoAdmin(ctx, repo, doer)
+ has, err := IsUserRepoAdminCtx(ctx, repo, doer)
if err != nil {
return fmt.Errorf("GetUserRepoPermission: %v", err)
} else if !has {