Fixing clippy

delete_local_image_on_delete_account
Dessalines 2024-03-27 09:59:34 -04:00
parent ac2ebc378b
commit 8b4c363c44
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ use lemmy_api_common::{
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
site::PurgePerson,
utils::{delete_local_user_images, is_admin, purge_user_account},
utils::{is_admin, purge_user_account},
SuccessResponse,
};
use lemmy_db_schema::{
@ -40,7 +40,7 @@ pub async fn purge_person(
.await?;
// Clear profile data.
purge_user_account(data.person_id, &mut context.pool()).await?;
purge_user_account(data.person_id, &context).await?;
// Keep person record, but mark as banned to prevent login or refetching from home instance.
let person = Person::update(

View File

@ -664,13 +664,13 @@ pub async fn purge_image_posts_for_person(
}
/// Delete a local_user's images
pub async fn delete_local_user_images(
async fn delete_local_user_images(
person_id: PersonId,
context: &LemmyContext,
) -> Result<(), LemmyError> {
if let Ok(local_user) = LocalUserView::read_person(&mut context.pool(), person_id).await {
let pictrs_uploads =
LocalImage::get_all_by_local_user_id(&mut context.pool(), &local_user.local_user.id).await?;
LocalImage::get_all_by_local_user_id(&mut context.pool(), local_user.local_user.id).await?;
// Delete their images
for upload in pictrs_uploads {