Skip to content

Commit 210dc90

Browse files
lunnyLinux User
authored and
Linux User
committed
Fix redirect bug when creating issue from a project (go-gitea#23971)
Fix go-gitea#23966
1 parent a00e473 commit 210dc90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/web/repo/issue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,8 @@ func NewIssuePost(ctx *context.Context) {
11501150
}
11511151

11521152
log.Trace("Issue created: %d/%d", repo.ID, issue.ID)
1153-
if ctx.FormString("redirect_after_creation") == "project" {
1154-
ctx.Redirect(ctx.Repo.RepoLink + "/projects/" + strconv.FormatInt(form.ProjectID, 10))
1153+
if ctx.FormString("redirect_after_creation") == "project" && projectID > 0 {
1154+
ctx.Redirect(ctx.Repo.RepoLink + "/projects/" + strconv.FormatInt(projectID, 10))
11551155
} else {
11561156
ctx.Redirect(issue.Link())
11571157
}

0 commit comments

Comments
 (0)