If we have a username, we should look that up even if we do not have a
first name.
This commit is contained in:
Daniel Meltzer 2018-07-18 22:10:36 -04:00 committed by snipe
parent f0332a7388
commit 19396b2107

View file

@ -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;