fix test email for string

pull/1594/head
Berkeley Martinez 2015-08-05 22:56:23 -07:00
parent 0ce81bbabb
commit ce9e2ebcae
1 changed files with 3 additions and 1 deletions

View File

@ -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();
}); });