Editing a torrent now redirects to torrent view page (fix #1282) (#1286)
* fix #1282 * Update edit.go * Update view.go * Update view.go
Cette révision appartient à :
Parent
3752efe25f
révision
ef25eddfd6
2 fichiers modifiés avec 6 ajouts et 1 suppressions
|
@ -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 {
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket