Update create_or_edit_get.rs

This commit is contained in:
Adrian Woźniak 2023-07-29 20:47:21 +02:00
parent d6795a3725
commit f19bbe39e8

View File

@ -59,6 +59,8 @@ async fn create_or_edit_get<E: ActixAdminViewModelTrait>(session: &Session, req:
model = res; model = res;
}, },
Err(e) => { Err(e) => {
#[cfg(enable-tracing)]
tracing::error!("{e}");
errors.push(e); errors.push(e);
model = ActixAdminModel::create_empty(); model = ActixAdminModel::create_empty();
} }
@ -97,6 +99,10 @@ async fn create_or_edit_get<E: ActixAdminViewModelTrait>(session: &Session, req:
let body = actix_admin.tera let body = actix_admin.tera
.render("create_or_edit.html", &ctx) .render("create_or_edit.html", &ctx)
.map_err(|err| error::ErrorInternalServerError(err))?; .map_err(|err| {
#[cfg(enable-tracing)]
tracing::error!("{err}");
error::ErrorInternalServerError(err)
})?;
Ok(http_response_code.content_type("text/html").body(body)) Ok(http_response_code.content_type("text/html").body(body))
} }