Fix redirect bug when creating issue from a project (#23971)

Fix #23966
pull/23991/head^2
Lunny Xiao 2 years ago committed by GitHub
parent 8f00979f73
commit b918a2c4fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      routers/web/repo/issue.go

@ -1154,8 +1154,8 @@ func NewIssuePost(ctx *context.Context) {
}
log.Trace("Issue created: %d/%d", repo.ID, issue.ID)
if ctx.FormString("redirect_after_creation") == "project" {
ctx.Redirect(ctx.Repo.RepoLink + "/projects/" + strconv.FormatInt(form.ProjectID, 10))
if ctx.FormString("redirect_after_creation") == "project" && projectID > 0 {
ctx.Redirect(ctx.Repo.RepoLink + "/projects/" + strconv.FormatInt(projectID, 10))
} else {
ctx.Redirect(issue.Link())
}

Loading…
Cancel
Save