Fix #701 Preferable default theme (#746)

* Make it possible to update users.preferred_theme to NULL

* Make preferred them null when 'Default theme' is selected

* Run cargo fmt
This commit is contained in:
KITAITI Makoto
2020-04-13 00:36:00 +09:00
committed by GitHub
parent 506fe9955d
commit b834d1c282
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -399,7 +399,10 @@ pub fn update(
)
.0,
);
user.preferred_theme = form.theme.clone();
user.preferred_theme = form
.theme
.clone()
.and_then(|t| if &t == "" { None } else { Some(t) });
user.hide_custom_css = form.hide_custom_css;
let _: User = user.save_changes(&*conn).map_err(Error::from)?;