Skip to content

Commit

Permalink
Fix redirect bug when creating issue from a project (go-gitea#23971)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored Apr 8, 2023
1 parent 8f00979 commit b918a2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit b918a2c

Please sign in to comment.