A free open source IT asset/license management system
Added a condition to ensure that only assets checked out to an user that is being deleted are updating their status (#9233)
Ivan Nieto Vivancod64b35c34802
diff --git a/app/Http/Controllers/Users/BulkUsersController.php b/app/Http/Controllers/Users/BulkUsersController.phpindex 92a01f6283..7bda003802 100644--- a/app/Http/Controllers/Users/BulkUsersController.php+++ b/app/Http/Controllers/Users/BulkUsersController.php@@ -174,7 +174,7 @@ class BulkUsersController extends Controller}$users = User::whereIn('id', $user_raw_array)->get();- $assets = Asset::whereIn('assigned_to', $user_raw_array)->get();+ $assets = Asset::whereIn('assigned_to', $user_raw_array)->where('assigned_type', 'App\Models\User')->get();$accessories = DB::table('accessories_users')->whereIn('assigned_to', $user_raw_array)->get();$licenses = DB::table('license_seats')->whereIn('assigned_to', $user_raw_array)->get();