Refactor account deletion condition in ProfileController

This commit is contained in:
Sebastian Albert 2026-05-19 16:18:50 +02:00 committed by GitHub
parent 726831c511
commit c7309627ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -126,8 +126,8 @@ public function destroy(ProfileDeleteRequest $request): RedirectResponse
$user->workspaces()->detach();
if ($account) {
$account->delete();
if ($account && $user->isAccountOwner()) {
$account->delete();
}
});