Skip to content
Snippets Groups Projects
Unverified Commit b9e8d6ed authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4330 from JediKev/issue/user-import-no-email

issue: User Import No Email
parents 19fa6d07 c8e2c3f1
No related branches found
No related tags found
No related merge requests found
...@@ -452,7 +452,7 @@ implements TemplateVariable { ...@@ -452,7 +452,7 @@ implements TemplateVariable {
db_autocommit(false); db_autocommit(false);
$records = $importer->importCsv(UserForm::getUserForm()->getFields(), $defaults); $records = $importer->importCsv(UserForm::getUserForm()->getFields(), $defaults);
foreach ($records as $data) { foreach ($records as $data) {
if (!isset($data['email']) || !isset($data['name'])) if (!Validator::is_email($data['email']) || empty($data['name']))
throw new ImportError('Both `name` and `email` fields are required'); throw new ImportError('Both `name` and `email` fields are required');
if (!($user = static::fromVars($data, true, true))) if (!($user = static::fromVars($data, true, true)))
throw new ImportError(sprintf(__('Unable to import user: %s'), throw new ImportError(sprintf(__('Unable to import user: %s'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment