Skip to content

Commit

Permalink
fixing overridden variable from request form value change
Browse files Browse the repository at this point in the history
  • Loading branch information
nilslice committed Feb 9, 2017
1 parent f740d2b commit 7fe9804
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions system/admin/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,8 @@ func approveContentHandler(res http.ResponseWriter, req *http.Request) {
return
}

pendingID := req.FormValue("id")

t := req.FormValue("type")
if strings.Contains(t, "__") {
t = strings.Split(t, "__")[0]
Expand Down Expand Up @@ -1406,9 +1408,8 @@ func approveContentHandler(res http.ResponseWriter, req *http.Request) {
return
}

pendID := req.FormValue("id")
if pendID != "" {
err = db.DeleteContent(req.FormValue("type")+":"+pendID, req.Form)
if pendingID != "" {
err = db.DeleteContent(req.FormValue("type")+":"+pendingID, req.Form)
if err != nil {
log.Println("Failed to remove content after approval:", err)
}
Expand Down

0 comments on commit 7fe9804

Please sign in to comment.