diff options
Diffstat (limited to 'services/pull')
-rw-r--r-- | services/pull/pull.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/pull/pull.go b/services/pull/pull.go index 959da67405..8e6110ac36 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -11,14 +11,21 @@ import ( "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" api "code.gitea.io/gitea/modules/structs" + issue_service "code.gitea.io/gitea/services/issue" ) // NewPullRequest creates new pull request with labels for repository. -func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int64, uuids []string, pr *models.PullRequest, patch []byte) error { +func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int64, uuids []string, pr *models.PullRequest, patch []byte, assigneeIDs []int64) error { if err := models.NewPullRequest(repo, pull, labelIDs, uuids, pr, patch); err != nil { return err } + for _, assigneeID := range assigneeIDs { + if err := issue_service.AddAssigneeIfNotAssigned(pull, pull.Poster, assigneeID); err != nil { + return err + } + } + if err := models.NotifyWatchers(&models.Action{ ActUserID: pull.Poster.ID, ActUser: pull.Poster, |