summaryrefslogtreecommitdiff
path: root/system/admin/handlers.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-11-02 02:03:12 -0700
committerSteve Manuel <nilslice@gmail.com>2016-11-02 02:03:12 -0700
commitb782dc0a2dad9b4bf0de267d516c1291bbd8da1c (patch)
treebba0898754d84791c4abc54a7e0ffc2cfc9c303e /system/admin/handlers.go
parent2bc4e3714ed16977135a2329e881f860930f2513 (diff)
adding fix for redirect after save on pending post content
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r--system/admin/handlers.go12
1 files changed, 10 insertions, 2 deletions
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)