comment the hot mess, just in case i forget

This commit is contained in:
Ted Unangst 2019-09-17 10:11:10 -04:00
parent c8c736839b
commit 49e944d8d2

10
web.go
View file

@ -841,12 +841,17 @@ func edithonkpage(w http.ResponseWriter, r *http.Request) {
return return
} }
noise := honk.Noise
if honk.Precis != "" {
noise = honk.Precis + "\n\n" + noise
}
honks := []*Honk{honk} honks := []*Honk{honk}
reverbolate(u.UserID, honks) reverbolate(u.UserID, honks)
templinfo := getInfo(r) templinfo := getInfo(r)
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
templinfo["Honks"] = honks templinfo["Honks"] = honks
templinfo["Noise"] = honk.Noise templinfo["Noise"] = noise
templinfo["ServerMessage"] = "honk edit" templinfo["ServerMessage"] = "honk edit"
templinfo["UpdateXID"] = honk.XID templinfo["UpdateXID"] = honk.XID
err := readviews.Execute(w, "honkpage.html", templinfo) err := readviews.Execute(w, "honkpage.html", templinfo)
@ -855,6 +860,7 @@ func edithonkpage(w http.ResponseWriter, r *http.Request) {
} }
} }
// what a hot mess this function is
func submithonk(w http.ResponseWriter, r *http.Request) { func submithonk(w http.ResponseWriter, r *http.Request) {
rid := r.FormValue("rid") rid := r.FormValue("rid")
noise := r.FormValue("noise") noise := r.FormValue("noise")
@ -1054,9 +1060,7 @@ func submithonk(w http.ResponseWriter, r *http.Request) {
if updatexid != "" { if updatexid != "" {
updatehonk(honk) updatehonk(honk)
} else { } else {
err := savehonk(honk) err := savehonk(honk)
if err != nil { if err != nil {
log.Printf("uh oh") log.Printf("uh oh")