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

@ -574,7 +574,7 @@ func NewIssuePost(ctx *context.Context, form auth.CreateIssueForm) {
Content: form.Content,
Ref: form.Ref,
}
if err := issue_service.NewIssue(repo, issue, labelIDs, attachments); err != nil {
if err := issue_service.NewIssue(repo, issue, labelIDs, attachments, assigneeIDs); err != nil {
if models.IsErrUserDoesNotHaveAccessToRepo(err) {
ctx.Error(400, "UserDoesNotHaveAccessToRepo", err.Error())
return
@ -583,13 +583,6 @@ func NewIssuePost(ctx *context.Context, form auth.CreateIssueForm) {
return
}
if err := issue_service.AddAssignees(issue, ctx.User, assigneeIDs); err != nil {
log.Error("AddAssignees: %v", err)
ctx.Flash.Error(ctx.Tr("issues.assignee.error"))
}
notification.NotifyNewIssue(issue)
log.Trace("Issue created: %d/%d", repo.ID, issue.ID)
ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + com.ToStr(issue.Index))
}