1
1
mirror of https://github.com/go-gitea/gitea synced 2025-11-03 12:58:29 +00:00

Add missing database transaction for new issue (#29490) (#29607)

When creating an issue, inserting issue, assign users and set project
should be in the same transaction.

Backport #29490
This commit is contained in:
Lunny Xiao
2024-03-06 00:37:55 +08:00
committed by GitHub
parent 02df269d24
commit 5667ef9aab
7 changed files with 31 additions and 26 deletions

View File

@@ -1481,7 +1481,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
ctx.Error(http.StatusBadRequest, "user hasn't the permission to write to projects")
return
}
if err := issues_model.ChangeProjectAssign(pullIssue, ctx.Doer, projectID); err != nil {
if err := issues_model.ChangeProjectAssign(ctx, pullIssue, ctx.Doer, projectID); err != nil {
ctx.ServerError("ChangeProjectAssign", err)
return
}