aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/repo/issue_new.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/routers/web/repo/issue_new.go b/routers/web/repo/issue_new.go
index 32daa3e48f..9115fc1771 100644
--- a/routers/web/repo/issue_new.go
+++ b/routers/web/repo/issue_new.go
@@ -276,13 +276,16 @@ func ValidateRepoMetasForNewIssue(ctx *context.Context, form forms.CreateIssueFo
}
pageMetaData.ProjectsData.SelectedProjectID = form.ProjectID
+ // prepare assignees
candidateAssignees := toSet(pageMetaData.AssigneesData.CandidateAssignees, func(user *user_model.User) int64 { return user.ID })
inputAssigneeIDs, _ := base.StringsToInt64s(strings.Split(form.AssigneeIDs, ","))
- if len(inputAssigneeIDs) > 0 && !candidateAssignees.Contains(inputAssigneeIDs...) {
- ctx.NotFound("", nil)
- return ret
+ var assigneeIDStrings []string
+ for _, inputAssigneeID := range inputAssigneeIDs {
+ if candidateAssignees.Contains(inputAssigneeID) {
+ assigneeIDStrings = append(assigneeIDStrings, strconv.FormatInt(inputAssigneeID, 10))
+ }
}
- pageMetaData.AssigneesData.SelectedAssigneeIDs = form.AssigneeIDs
+ pageMetaData.AssigneesData.SelectedAssigneeIDs = strings.Join(assigneeIDStrings, ",")
// Check if the passed reviewers (user/team) actually exist
var reviewers []*user_model.User