mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Revert "Prevent to delete a user if still has consumables associated to them"
This commit is contained in:
parent
60d1578a01
commit
5feea17f8d
|
@ -441,10 +441,6 @@ class UsersController extends Controller
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has '.$user->accessories->count().' accessories associated with them.'));
|
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has '.$user->accessories->count().' accessories associated with them.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($user->consumables) && ($user->consumables->count() > 0)) {
|
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has '.$user->consumables->count().' consumables associated with them.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($user->managedLocations()) && ($user->managedLocations()->count() > 0)) {
|
if (($user->managedLocations()) && ($user->managedLocations()->count() > 0)) {
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has '.$user->managedLocations()->count().' locations that they manage.'));
|
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has '.$user->managedLocations()->count().' locations that they manage.'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,12 +348,6 @@ class UsersController extends Controller
|
||||||
->with('error', 'This user still has '.$accessoriesCount.' accessories associated with them.');
|
->with('error', 'This user still has '.$accessoriesCount.' accessories associated with them.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($user->consumables()) && (($consumablesCount = $user->consumables()->count())) > 0) {
|
|
||||||
// Redirect to the user management page
|
|
||||||
return redirect()->route('users.index')
|
|
||||||
->with('error', 'This user still has '.$consumablesCount.' consumables associated with them.');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($user->managedLocations()) && (($managedLocationsCount = $user->managedLocations()->count())) > 0) {
|
if (($user->managedLocations()) && (($managedLocationsCount = $user->managedLocations()->count())) > 0) {
|
||||||
// Redirect to the user management page
|
// Redirect to the user management page
|
||||||
return redirect()->route('users.index')
|
return redirect()->route('users.index')
|
||||||
|
|
Loading…
Reference in a new issue