diff --git a/controllers/torrent/edit.go b/controllers/torrent/edit.go index a897ff22..4d7abad2 100644 --- a/controllers/torrent/edit.go +++ b/controllers/torrent/edit.go @@ -3,6 +3,7 @@ package torrentController import ( "net/http" "strconv" + "fmt" "github.com/NyaaPantsu/nyaa/controllers/router" "github.com/NyaaPantsu/nyaa/models" @@ -49,7 +50,8 @@ func TorrentPostEditUserPanel(c *gin.Context) { } if !messages.HasErrors() { upload.UpdateTorrent(&uploadForm, torrent, currentUser).Update(currentUser.HasAdmin()) - messages.AddInfoT("infos", "torrent_updated") + c.Redirect(http.StatusSeeOther, fmt.Sprintf("/view/%d?success_edit", id)) + return } templates.Form(c, "site/torrents/edit.jet.html", uploadForm.Update) } else { diff --git a/controllers/torrent/view.go b/controllers/torrent/view.go index 40597c85..2f23370a 100644 --- a/controllers/torrent/view.go +++ b/controllers/torrent/view.go @@ -23,6 +23,9 @@ func ViewHandler(c *gin.Context) { if c.Request.URL.Query()["success"] != nil { messages.AddInfoT("infos", "torrent_uploaded") } + if c.Request.URL.Query()["success_edit"] != nil { + messages.AddInfoT("infos", "torrent_updated") + } if c.Request.URL.Query()["badcaptcha"] != nil { messages.AddErrorT("errors", "bad_captcha") }