diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index 945a95ba0..ba0aefa34 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -341,9 +341,7 @@ class AdminEmployeesControllerCore extends AdminController if (!($obj = $this->loadObject(true))) return false; $email = $this->getFieldValue($obj, 'email'); - if (!Validate::isEmail($email)) - $this->errors[] = Tools::displayError('Invalid email address.'); - elseif (Employee::employeeExists($email) && (!Tools::getValue('id_employee') || ($employee = new Employee((int)Tools::getValue('id_employee'))) && $employee->email != $email)) + if (Validate::isEmail($email) && Employee::employeeExists($email) && (!Tools::getValue('id_employee') || ($employee = new Employee((int)Tools::getValue('id_employee'))) && $employee->email != $email)) $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$email; }