mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-21 17:41:16 +02:00
Use for a repo action one database transaction (#19576)
... more context (part of #9307)
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user