fix: allow editor page with broken metadata

This commit is contained in:
trisua 2025-07-25 21:06:41 -04:00
parent 5597f0057e
commit 0c43a48349

View file

@ -157,11 +157,7 @@ async fn view_request(
let metadata: EntryMetadata = match toml::from_str(&EntryMetadata::ini_to_toml(&entry.metadata))
{
Ok(x) => x,
Err(e) => {
let mut ctx = default_context(&data, &build_code);
ctx.insert("error", &e.to_string());
return Html(tera.render("error.lisp", &ctx).unwrap());
}
Err(_) => EntryMetadata::default(),
};
if let Err(e) = metadata.validate() {
@ -259,11 +255,7 @@ async fn editor_request(
let metadata: EntryMetadata = match toml::from_str(&EntryMetadata::ini_to_toml(&entry.metadata))
{
Ok(x) => x,
Err(e) => {
let mut ctx = default_context(&data, &build_code);
ctx.insert("error", &e.to_string());
return Html(tera.render("error.lisp", &ctx).unwrap());
}
Err(_) => EntryMetadata::default(),
};
// ...