chore: Cleanup

This commit is contained in:
Ginger 2026-03-03 13:35:58 -05:00
parent ffa3c53847
commit 8b726a9c94
No known key found for this signature in database
4 changed files with 6 additions and 10 deletions

View file

@ -34,12 +34,11 @@ impl IntoResponse for WebError {
} }
let status = match &self { let status = match &self {
| Self::ValidationError(_) => StatusCode::BAD_REQUEST, | Self::ValidationError(_) | Self::BadRequest(_) => StatusCode::BAD_REQUEST,
| Self::BadRequest(_) => StatusCode::BAD_REQUEST,
| _ => StatusCode::INTERNAL_SERVER_ERROR, | _ => StatusCode::INTERNAL_SERVER_ERROR,
}; };
let template = Error { error: self, status: status.clone() }; let template = Error { error: self, status };
if let Ok(body) = template.render() { if let Ok(body) = template.render() {
(status, Html(body)).into_response() (status, Html(body)).into_response()

View file

@ -1,8 +1,7 @@
use askama::{Template, filters::HtmlSafe}; use askama::{Template, filters::HtmlSafe};
use base64::Engine; use base64::Engine;
use conduwuit_core::{Result, result::FlatOk, utils::TryFutureExtExt}; use conduwuit_core::result::FlatOk;
use conduwuit_service::Services; use conduwuit_service::Services;
use futures::TryFutureExt;
use ruma::UserId; use ruma::UserId;
pub(super) mod form; pub(super) mod form;
@ -32,7 +31,7 @@ pub(super) struct UserCard<'a> {
impl HtmlSafe for UserCard<'_> {} impl HtmlSafe for UserCard<'_> {}
impl<'a> UserCard<'a> { impl<'a> UserCard<'a> {
pub async fn for_local_user(services: &Services, user_id: &'a UserId) -> Self { pub(super) async fn for_local_user(services: &Services, user_id: &'a UserId) -> Self {
let display_name = services.users.displayname(user_id).await.ok(); let display_name = services.users.displayname(user_id).await.ok();
let avatar_src = async { let avatar_src = async {

File diff suppressed because one or more lines are too long

View file

@ -19,6 +19,7 @@
<input <input
type="{{ input.input_type }}" type="{{ input.input_type }}"
id="{{ input.id }}" id="{{ input.id }}"
autocomplete="{{ input.autocomplete }}
{% if input.type_name.is_some() %}name="{{ input.id }}"{% endif %} {% if input.type_name.is_some() %}name="{{ input.id }}"{% endif %}
{% if input.required %}required{% endif %} {% if input.required %}required{% endif %}
> >