1
0
Fork 0
forked from forgejo/forgejo

Move issue notifications (#8713)

This commit is contained in:
Lunny Xiao 2019-10-29 00:45:43 +08:00 committed by GitHub
parent e3875ace91
commit af8957bc4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 55 deletions

View file

@ -24,7 +24,6 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/gitdiff"
issue_service "code.gitea.io/gitea/services/issue"
pull_service "code.gitea.io/gitea/services/pull"
repo_service "code.gitea.io/gitea/services/repository"
@ -772,7 +771,7 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
// FIXME: check error in the case two people send pull request at almost same time, give nice error prompt
// instead of 500.
if err := pull_service.NewPullRequest(repo, pullIssue, labelIDs, attachments, pullRequest, patch); err != nil {
if err := pull_service.NewPullRequest(repo, pullIssue, labelIDs, attachments, pullRequest, patch, assigneeIDs); err != nil {
if models.IsErrUserDoesNotHaveAccessToRepo(err) {
ctx.Error(400, "UserDoesNotHaveAccessToRepo", err.Error())
return
@ -784,11 +783,6 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
return
}
if err := issue_service.AddAssignees(pullIssue, ctx.User, assigneeIDs); err != nil {
log.Error("AddAssignees: %v", err)
ctx.Flash.Error(ctx.Tr("issues.assignee.error"))
}
notification.NotifyNewPullRequest(pullRequest)
log.Trace("Pull request created: %d/%d", repo.ID, pullIssue.ID)