use crate::{
captcha_espeak_wav_base64,
- check_optional_url,
collect_moderated_communities,
get_user_from_jwt,
get_user_from_jwt_opt,
};
use lemmy_db_queries::{
diesel_option_overwrite,
+ diesel_option_overwrite_to_url,
source::{
comment::Comment_,
community::Community_,
let data: &SaveUserSettings = &self;
let user = get_user_from_jwt(&data.auth, context.pool()).await?;
- let avatar = diesel_option_overwrite(&data.avatar);
- let banner = diesel_option_overwrite(&data.banner);
+ let avatar = diesel_option_overwrite_to_url(&data.avatar)?;
+ let banner = diesel_option_overwrite_to_url(&data.banner)?;
let email = diesel_option_overwrite(&data.email);
let bio = diesel_option_overwrite(&data.bio);
let preferred_username = diesel_option_overwrite(&data.preferred_username);
let matrix_user_id = diesel_option_overwrite(&data.matrix_user_id);
- // Check to make sure the avatar and banners are urls
- check_optional_url(&avatar)?;
- check_optional_url(&banner)?;
-
if let Some(Some(bio)) = &bio {
if bio.chars().count() > 300 {
return Err(ApiError::err("bio_length_overflow").into());