From 9c45a199f8f4ae5bd34238c34bc04f5b3befa444 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 26 Mar 2024 11:28:44 -0400 Subject: [PATCH] Use purge_user_account instead of Person::delete_account in purge person. --- crates/api/src/site/purge/person.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/api/src/site/purge/person.rs b/crates/api/src/site/purge/person.rs index 0bc2a8822..774fdeda1 100644 --- a/crates/api/src/site/purge/person.rs +++ b/crates/api/src/site/purge/person.rs @@ -5,7 +5,7 @@ use lemmy_api_common::{ context::LemmyContext, send_activity::{ActivityChannel, SendActivityData}, site::PurgePerson, - utils::{delete_local_user_images, is_admin}, + utils::{delete_local_user_images, is_admin, purge_user_account}, SuccessResponse, }; use lemmy_db_schema::{ @@ -26,9 +26,6 @@ pub async fn purge_person( ) -> Result, LemmyError> { // Only let admin purge an item is_admin(&local_user_view)?; - delete_local_user_images(data.person_id, &context) - .await - .ok(); let person = Person::read(&mut context.pool(), data.person_id).await?; ban_nonlocal_user_from_local_communities( @@ -43,7 +40,8 @@ pub async fn purge_person( .await?; // Clear profile data. - Person::delete_account(&mut context.pool(), data.person_id).await?; + purge_user_account(data.person_id, &mut context.pool()).await?; + // Keep person record, but mark as banned to prevent login or refetching from home instance. let person = Person::update( &mut context.pool(),