make sure everything is wendered

This commit is contained in:
Joe Ardent 2025-08-29 11:10:42 -07:00
parent fc26533460
commit 3dd25b2063
3 changed files with 8 additions and 19 deletions

View file

@ -6,13 +6,14 @@ use http::StatusCode;
use julid::Julid;
use serde::{Deserialize, Serialize};
use sqlx::SqlitePool;
use templates::{SignupErrorPage, SignupPage};
use crate::{WatchDate, WatchError};
use crate::{WatchDate, Wender};
pub mod handlers;
pub mod templates;
use templates::SignupErrorPage;
//-************************************************************************
// Error types for user creation
//-************************************************************************
@ -178,10 +179,7 @@ impl IntoResponse for CreateInviteError {
StatusCode::OK,
SignupErrorPage("Sorry, invitations require an owner".to_string())
.render()
.map_err(|e| {
tracing::error!("could not render create user error page, got {e}");
StatusCode::INTERNAL_SERVER_ERROR
}),
.wender(),
)
.into_response(),
_ => (StatusCode::OK, format!("{self}")).into_response(),
@ -199,10 +197,7 @@ impl IntoResponse for CreateUserError {
StatusCode::OK,
SignupErrorPage("Sorry, that invitation isn't valid.".to_string())
.render()
.map_err(|e| {
tracing::error!("could not render create user error page, got {e}");
StatusCode::INTERNAL_SERVER_ERROR
}),
.wender(),
)
.into_response(),
_ => (StatusCode::OK, format!("{self}")).into_response(),

View file

@ -1,7 +1,6 @@
use askama::Template;
use axum::{
extract::{Form, Path, State},
http::StatusCode,
response::{IntoResponse, Redirect},
};
use http::HeaderValue;
@ -14,8 +13,8 @@ use super::{
AddError, AddErrorKind, EditError, EditErrorKind, WatchesError,
};
use crate::{
misc_util::empty_string_as_none, AuthSession, MyWatchesPage, ShowKind, Watch, WatchError,
WatchQuest, Wender,
misc_util::empty_string_as_none, AuthSession, MyWatchesPage, ShowKind, Watch, WatchQuest,
Wender,
};
//-************************************************************************
@ -286,10 +285,7 @@ pub async fn get_watch(
user: auth.user,
}
.render()
.map_err(|e| {
tracing::error!("could not render watch page, got {e}");
StatusCode::INTERNAL_SERVER_ERROR
})
.wender()
.into_response()
}

View file

@ -3,8 +3,6 @@ use http::StatusCode;
use julid::Julid;
use serde::{Deserialize, Serialize};
use crate::WatchError;
pub mod handlers;
pub mod templates;