mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Check for accessories
This commit is contained in:
parent
8900672181
commit
6b982ec253
|
@ -360,6 +360,12 @@ class UsersController extends Controller
|
|||
return Redirect::route('users')->with('error', 'This user still has ' . count($user->licenses) . ' licenses associated with them.');
|
||||
}
|
||||
|
||||
if (count($user->accessories) > 0) {
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', 'This user still has ' . count($user->accessories) . ' accessories associated with them.');
|
||||
}
|
||||
|
||||
// Delete the user
|
||||
$user->delete();
|
||||
|
||||
|
|
Loading…
Reference in a new issue