Check for accessories

This commit is contained in:
snipe 2016-04-21 21:01:45 -07:00
parent 8900672181
commit 6b982ec253

View file

@ -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();