chore: Cleanup
This commit is contained in:
parent
ffa3c53847
commit
8b726a9c94
4 changed files with 6 additions and 10 deletions
|
|
@ -34,12 +34,11 @@ impl IntoResponse for WebError {
|
|||
}
|
||||
|
||||
let status = match &self {
|
||||
| Self::ValidationError(_) => StatusCode::BAD_REQUEST,
|
||||
| Self::BadRequest(_) => StatusCode::BAD_REQUEST,
|
||||
| Self::ValidationError(_) | Self::BadRequest(_) => StatusCode::BAD_REQUEST,
|
||||
| _ => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
};
|
||||
|
||||
let template = Error { error: self, status: status.clone() };
|
||||
let template = Error { error: self, status };
|
||||
|
||||
if let Ok(body) = template.render() {
|
||||
(status, Html(body)).into_response()
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
use askama::{Template, filters::HtmlSafe};
|
||||
use base64::Engine;
|
||||
use conduwuit_core::{Result, result::FlatOk, utils::TryFutureExtExt};
|
||||
use conduwuit_core::result::FlatOk;
|
||||
use conduwuit_service::Services;
|
||||
use futures::TryFutureExt;
|
||||
use ruma::UserId;
|
||||
|
||||
pub(super) mod form;
|
||||
|
|
@ -32,7 +31,7 @@ pub(super) struct UserCard<'a> {
|
|||
impl HtmlSafe for UserCard<'_> {}
|
||||
|
||||
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 avatar_src = async {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -19,6 +19,7 @@
|
|||
<input
|
||||
type="{{ input.input_type }}"
|
||||
id="{{ input.id }}"
|
||||
autocomplete="{{ input.autocomplete }}
|
||||
{% if input.type_name.is_some() %}name="{{ input.id }}"{% endif %}
|
||||
{% if input.required %}required{% endif %}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue