Skip to content
Snippets Groups Projects
Commit 79205975 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #617 from protich/issue/613


Ensure the email doesn't already exist before creating it.

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 596443d1 0e88dd1a
No related branches found
No related tags found
No related merge requests found
......@@ -84,8 +84,9 @@ class User extends UserModel {
'name'=>$data['name'],
'created'=>new SqlFunction('NOW'),
'updated'=>new SqlFunction('NOW'),
'default_email'=>
UserEmail::create(array('address'=>$data['email']))
//XXX: Do plain create once the cause
// of the detached emails is fixed.
'default_email' => UserEmail::ensure($data['email'])
));
$user->save(true);
$user->emails->add($user->default_email);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment