mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Logic Fix (#5877)
If we have a username, we should look that up even if we do not have a first name.
This commit is contained in:
parent
f0332a7388
commit
19396b2107
|
@ -285,17 +285,16 @@ abstract class Importer
|
|||
}
|
||||
}
|
||||
|
||||
// If at this point we have not found a username or first name, bail out in shame.
|
||||
if(empty($user_array['username']) || empty($user_array['first_name'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check for a matching user after trying to guess username.
|
||||
if($user = User::where('username', $user_array['username'])->first()) {
|
||||
$this->log('User '.$user_array['username'].' already exists');
|
||||
return $user;
|
||||
}
|
||||
|
||||
// If at this point we have not found a username or first name, bail out in shame.
|
||||
if(empty($user_array['username']) || empty($user_array['first_name'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No Luck, let's create one.
|
||||
$user = new User;
|
||||
|
|
Loading…
Reference in a new issue