From e2ab2f7306a7adf31daf9f560f840be9174e583f Mon Sep 17 00:00:00 2001 From: Jean-Christophe BEGUE Date: Tue, 11 Sep 2018 13:00:59 +0200 Subject: [PATCH] Save None instead of empty password hint --- src/api/core/accounts.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index ffc76f3a..cfec3e73 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -82,7 +82,10 @@ fn post_profile(data: JsonUpcase, headers: Headers, conn: DbConn) - let mut user = headers.user; user.name = data.Name; - user.password_hint = data.MasterPasswordHint; + user.password_hint = match data.MasterPasswordHint { + Some(ref h) if h.is_empty() => None, + _ => data.MasterPasswordHint, + }; user.save(&conn); Ok(Json(user.to_json(&conn)))