mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Fix PR/issue redirects when having external tracker (#9339)
* Make sure only issues are redirected to external tracker * Ensure correct redirects for pulls after dependency or watch. * NewIssuePost is always issues so no need to redirect with type.
This commit is contained in:
parent
81a52442a1
commit
f46176a418
3 changed files with 16 additions and 16 deletions
|
@ -5,7 +5,6 @@
|
|||
package repo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
|
@ -31,7 +30,7 @@ func AddDependency(ctx *context.Context) {
|
|||
}
|
||||
|
||||
// Redirect
|
||||
defer ctx.Redirect(fmt.Sprintf("%s/issues/%d", ctx.Repo.RepoLink, issueIndex), http.StatusSeeOther)
|
||||
defer ctx.Redirect(issue.HTMLURL(), http.StatusSeeOther)
|
||||
|
||||
// Dependency
|
||||
dep, err := models.GetIssueByID(depID)
|
||||
|
@ -85,7 +84,7 @@ func RemoveDependency(ctx *context.Context) {
|
|||
}
|
||||
|
||||
// Redirect
|
||||
ctx.Redirect(fmt.Sprintf("%s/issues/%d", ctx.Repo.RepoLink, issueIndex), http.StatusSeeOther)
|
||||
ctx.Redirect(issue.HTMLURL(), http.StatusSeeOther)
|
||||
|
||||
// Dependency Type
|
||||
depTypeStr := ctx.Req.PostForm.Get("dependencyType")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue