mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Only update asset locations to assets checked out to users.
This commit is contained in:
parent
0149ed75fd
commit
b5c8251539
|
@ -427,7 +427,7 @@ class LdapSync extends Command
|
||||||
$user->groups()->attach($ldap_default_group);
|
$user->groups()->attach($ldap_default_group);
|
||||||
}
|
}
|
||||||
//updates assets location based on user's location
|
//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 {
|
} else {
|
||||||
foreach ($user->getErrors()->getMessages() as $key => $err) {
|
foreach ($user->getErrors()->getMessages() as $key => $err) {
|
||||||
|
|
Loading…
Reference in a new issue