mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Throw an error if the asset cannot be updated in the merge
This commit is contained in:
parent
8c19b11e73
commit
a43fb060f4
|
@ -54,7 +54,10 @@ class MergeUsersByUsername extends Command
|
||||||
foreach ($bad_user->assets as $asset) {
|
foreach ($bad_user->assets as $asset) {
|
||||||
$this->info( 'Updating asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
|
$this->info( 'Updating asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
|
||||||
$asset->assigned_to = $user->id;
|
$asset->assigned_to = $user->id;
|
||||||
$asset->save();
|
if (!$asset->save()) {
|
||||||
|
$this->error( 'Could not update assigned_to field on asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
|
||||||
|
$this->error( 'Error saving: '.$asset->getErrors());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Walk the list of licenses
|
// Walk the list of licenses
|
||||||
|
|
Loading…
Reference in a new issue