From beeb8dc5fef499f5567fa5f627fd158fd3928b3b Mon Sep 17 00:00:00 2001 From: ygerlach <100762533+ygerlach@users.noreply.github.com> Date: Fri, 17 Jan 2025 23:06:53 +0100 Subject: [PATCH] :bug: Fix: use correct deletion function for inactive users --- .../Controllers/Backend/User/AccountDeletionController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Backend/User/AccountDeletionController.php b/app/Http/Controllers/Backend/User/AccountDeletionController.php index 17bc71976..5f94af1b0 100644 --- a/app/Http/Controllers/Backend/User/AccountDeletionController.php +++ b/app/Http/Controllers/Backend/User/AccountDeletionController.php @@ -4,6 +4,7 @@ use App\Helpers\CacheKey; use App\Http\Controllers\Controller; +use App\Http\Controllers\Backend\UserController; use App\Mail\AccountDeletionNotificationTwoWeeksBefore; use App\Models\User; use Exception; @@ -67,7 +68,7 @@ public static function deleteInactiveUsers(): void { } Log::info('Deleting inactive user ' . $user->id . ' (' . $user->email . ')'); - $user->delete(); + UserController::deleteUserAccount($user); } catch (Exception $e) { Log::error('Error deleting inactive user ' . $user->id . ' (' . $user->email . '): ' . $e->getMessage()); }