fix test email for string
parent
0ce81bbabb
commit
ce9e2ebcae
|
@ -48,7 +48,9 @@ module.exports = function(User) {
|
||||||
User.observe('before save', function({ instance: user }, next) {
|
User.observe('before save', function({ instance: user }, next) {
|
||||||
if (user) {
|
if (user) {
|
||||||
user.username = user.username.trim().toLowerCase();
|
user.username = user.username.trim().toLowerCase();
|
||||||
user.email = user.email.trim().toLowerCase();
|
user.email = typeof user.email === 'string' ?
|
||||||
|
user.email.trim().toLowerCase() :
|
||||||
|
user.email;
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue