Fix feature

This commit is contained in:
eraden 2023-07-29 20:52:07 +02:00 committed by Adrian Woźniak
parent 02a7a36ac7
commit 75b3a112a5
4 changed files with 8 additions and 8 deletions

View File

@ -117,7 +117,7 @@ pub enum ActixAdminError {
impl error::ResponseError for ActixAdminError {
fn error_response(&self) -> HttpResponse {
#[cfg(enable-tracing)]
#[cfg(feature="enable-tracing")]
tracing::debug!("{self}");
HttpResponse::build(self.status_code())
.insert_header(ContentType::html())

View File

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

View File

@ -125,7 +125,7 @@ pub async fn create_or_edit_post<E: ActixAdminViewModelTrait>(
.finish())
}
Err(e) => {
#[cfg(enable-tracing)]
#[cfg(feature="enable-tracing")]
tracing::error!("{e}");
errors.push(e);
render_form::<E>(
@ -187,7 +187,7 @@ async fn render_form<E: ActixAdminViewModelTrait>(
let notifications: Vec<ActixAdminNotification> = errors
.into_iter()
.map(|err| {
#[cfg(enable-tracing)]
#[cfg(feature="enable-tracing")]
tracing::error!("{err}");
ActixAdminNotification::from(err)
})
@ -197,7 +197,7 @@ async fn render_form<E: ActixAdminViewModelTrait>(
let body = actix_admin.tera
.render("create_or_edit.html", &ctx)
.map_err(|err| {
#[cfg(enable-tracing)]
#[cfg(feature="enable-tracing")]
tracing::error!("{err}");
error::ErrorInternalServerError(err)
})?;

View File

@ -30,7 +30,7 @@ pub async fn index(session: Session, data: web::Data<ActixAdmin>) -> Result<Http
let body = actix_admin.tera
.render("index.html", &ctx)
.map_err(|e| {
#[cfg(enable-tracing)]
#[cfg(feature="enable-tracing")]
tracing::error!("{}", e);
error::ErrorInternalServerError("Template error")
})?;
@ -41,7 +41,7 @@ pub async fn not_found(data: web::Data<ActixAdmin>) -> Result<HttpResponse, Erro
let body = data.get_ref().tera
.render("not_found.html", &Context::new())
.map_err(|e| {
#[cfg(enable-tracing)]
#[cfg(feature="enable-tracing")]
tracing::error!("{}", e);
error::ErrorInternalServerError("Template error")
})?;