From b5c8251539336c3b60e70455401999a0433fefcc Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 9 Dec 2024 17:40:10 +0000 Subject: [PATCH] Only update asset locations to assets checked out to users. --- app/Console/Commands/LdapSync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index 2338cebf75..e57fab19ab 100644 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -427,7 +427,7 @@ class LdapSync extends Command $user->groups()->attach($ldap_default_group); } //updates assets location based on user's location - Asset::where('assigned_to', '=', $user->id)->update(['location_id' => $user->location_id]); + Asset::where('assigned_to', '=', $user->id)->where('assigned_type', '=', User::class)->update(['location_id' => $user->location_id]); } else { foreach ($user->getErrors()->getMessages() as $key => $err) {