From 1d8793f4f84fd5c88dd36eedb83e0c06c24f7477 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Tue, 13 Jun 2017 20:57:08 -0400 Subject: Fix the fix of password bug --- templates/settings.tmpl | 2 +- web.go | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/settings.tmpl b/templates/settings.tmpl index 00b2125..9c68b16 100644 --- a/templates/settings.tmpl +++ b/templates/settings.tmpl @@ -24,7 +24,7 @@
- +
diff --git a/web.go b/web.go index 0810f76..31a8317 100644 --- a/web.go +++ b/web.go @@ -106,11 +106,13 @@ func (app *App) settings(w http.ResponseWriter, r *http.Request) { if r.Method == "POST" { u := &User{ - Id: se.UserId, - Name: r.FormValue("name"), - Email: r.FormValue("email"), - LfmName: r.FormValue("lfm_name"), - LfmPassword: md5hex(r.FormValue("lfm_password")), + Id: se.UserId, + Name: r.FormValue("name"), + Email: r.FormValue("email"), + LfmName: r.FormValue("lfm_name"), + } + if password := r.FormValue("lfm_password"); password != "" { + u.LfmPassword = md5hex(password) } if err := app.SaveUser(u); err != nil { log.Println(err) -- cgit v1.2.3-70-g09d2