mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 05:47:28 -08:00
Importer improvements. If user real name doesn't exist don't try to create the user.
This commit is contained in:
parent
fd0d04eba4
commit
e353df588f
|
@ -563,8 +563,9 @@ class ObjectImportCommand extends Command {
|
|||
if (!empty($user_username)) {
|
||||
if ($user = User::MatchEmailOrUsername($user_username, $user_email)
|
||||
->whereNotNull('username')->first()) {
|
||||
|
||||
$this->log('User '.$user_username.' already exists');
|
||||
} else {
|
||||
} else if(( $first_name != '') && ($last_name != '') && ($user_username != '')) {
|
||||
$user = new \App\Models\User;
|
||||
$password = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
|
||||
|
||||
|
@ -580,6 +581,8 @@ class ObjectImportCommand extends Command {
|
|||
$this->error('User: ' . $user->getErrors());
|
||||
}
|
||||
|
||||
} else {
|
||||
$user = new User;
|
||||
}
|
||||
} else {
|
||||
$user = new User;
|
||||
|
|
Loading…
Reference in a new issue