1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +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

@@ -100,8 +100,8 @@ func LoadIssuesFromBoardList(ctx context.Context, bs project_model.BoardList) (m
}
// ChangeProjectAssign changes the project associated with an issue
func ChangeProjectAssign(issue *Issue, doer *user_model.User, newProjectID int64) error {
ctx, committer, err := db.TxContext(db.DefaultContext)
func ChangeProjectAssign(ctx context.Context, issue *Issue, doer *user_model.User, newProjectID int64) error {
ctx, committer, err := db.TxContext(ctx)
if err != nil {
return err
}