diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-04-08 16:17:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-08 16:17:50 +0800 |
commit | b918a2c4fb62666d4f8bc1755f0dc5e1cdd94d53 (patch) | |
tree | dc8e3e3485fe95514f88743ccf72c36b0b961e4a /routers/web/repo/issue.go | |
parent | 8f00979f732c976b75086f75ab7e776d2ee18771 (diff) | |
download | gitea-b918a2c4fb62666d4f8bc1755f0dc5e1cdd94d53.tar.gz gitea-b918a2c4fb62666d4f8bc1755f0dc5e1cdd94d53.zip |
Fix redirect bug when creating issue from a project (#23971)
Fix #23966
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r-- | routers/web/repo/issue.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 5401d60b55..d251f2043c 100644 --- a/routers/web/repo/issue.go +++ b/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()) } |