Skip to content

Commit

Permalink
Only update asset locations to assets checked out to users.
Browse files Browse the repository at this point in the history
  • Loading branch information
uberbrady committed Dec 9, 2024
1 parent 0149ed7 commit b5c8251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Console/Commands/LdapSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function handle()
$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) {
Expand Down

0 comments on commit b5c8251

Please sign in to comment.