Fix issue with account deletions

Also, added the ignition file for customising the error page for devs
This commit is contained in:
2021-10-25 02:08:32 +01:00
parent de2c3a0efd
commit 3c0e33fef7
3 changed files with 128 additions and 1 deletions

View File

@@ -235,7 +235,7 @@ class UserController extends Controller
$this->authorize('delete', $user);
if ($request->confirmPrompt == 'DELETE ACCOUNT') {
$user->forceDelete();
$user->delete();
$request->session()->flash('success', __('User deleted successfully.'));
} else {
$request->session()->flash('error', __('Wrong confirmation text! Try again.'));

View File

@@ -63,6 +63,7 @@ class UserObserver
public function deleting(User $user)
{
Log::debug("Deleting observer running");
if ($user->isForceDeleting()) {
$user->profile->delete();
Log::debug('Referential integrity cleanup: Deleted profile!');