delete-old-avatar
Felix Ableitner 2024-03-26 16:00:49 +01:00
parent 8414b58662
commit 716143b126
1 changed files with 2 additions and 2 deletions

View File

@ -322,11 +322,11 @@ pub async fn replace_image(
if new_image.is_some() { if new_image.is_some() {
// Ignore errors because image may be stored externally. // Ignore errors because image may be stored externally.
if let Some(avatar) = &old_image { if let Some(avatar) = &old_image {
let image = LocalImage::delete_by_url(&mut context.pool(), &avatar) let image = LocalImage::delete_by_url(&mut context.pool(), avatar)
.await .await
.ok(); .ok();
if let Some(image) = image { if let Some(image) = image {
delete_image_from_pictrs(&image.pictrs_alias, &image.pictrs_delete_token, &context).await?; delete_image_from_pictrs(&image.pictrs_alias, &image.pictrs_delete_token, context).await?;
} }
} }
} }