diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-03-06 00:37:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-05 16:37:55 +0000 |
commit | 5667ef9aabc4069cbaa6a5c18181f9429376b48d (patch) | |
tree | 52213b2a46667696acdd138b75ebd2ae1b502714 /routers/api/v1/repo | |
parent | 02df269d2449462d7471a01b265be21bb5706fa2 (diff) | |
download | gitea-5667ef9aabc4069cbaa6a5c18181f9429376b48d.tar.gz gitea-5667ef9aabc4069cbaa6a5c18181f9429376b48d.zip |
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
Diffstat (limited to 'routers/api/v1/repo')
-rw-r--r-- | routers/api/v1/repo/issue.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 9c74370e10..fe9a491603 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -707,7 +707,7 @@ func CreateIssue(ctx *context.APIContext) { form.Labels = make([]int64, 0) } - if err := issue_service.NewIssue(ctx, ctx.Repo.Repository, issue, form.Labels, nil, assigneeIDs); err != nil { + if err := issue_service.NewIssue(ctx, ctx.Repo.Repository, issue, form.Labels, nil, assigneeIDs, 0); err != nil { if repo_model.IsErrUserDoesNotHaveAccessToRepo(err) { ctx.Error(http.StatusBadRequest, "UserDoesNotHaveAccessToRepo", err) return |