From b782dc0a2dad9b4bf0de267d516c1291bbd8da1c Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Wed, 2 Nov 2016 02:03:12 -0700 Subject: adding fix for redirect after save on pending post content --- system/admin/handlers.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'system') diff --git a/system/admin/handlers.go b/system/admin/handlers.go index e3d99cc..68d05c4 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -1050,8 +1050,16 @@ func editHandler(res http.ResponseWriter, req *http.Request) { host := req.URL.Host path := req.URL.Path sid := fmt.Sprintf("%d", id) - desURL := scheme + host + path + "?type=" + t + "&id=" + sid - http.Redirect(res, req, desURL, http.StatusFound) + if strings.Contains(t, "_") { + t = strings.Split(t, "_")[0] + } + redir := scheme + host + path + "?type=" + t + "&id=" + sid + + if req.URL.Query().Get("status") == "pending" { + redir += redir + "&status=pending" + } + + http.Redirect(res, req, redir, http.StatusFound) default: res.WriteHeader(http.StatusMethodNotAllowed) -- cgit v1.2.3