Tweak username-should-not-be-email error message

This commit is contained in:
Scott Erickson 2016-08-22 11:02:40 -07:00
parent fe49867043
commit cdba1788e7

View file

@ -376,7 +376,7 @@ UserSchema.pre('save', (next) ->
if not @allowEmailNames # for testing
filter = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i # https://news.ycombinator.com/item?id=5763990
if filter.test(name)
return next(new errors.UnprocessableEntity('Name may not be an email'))
return next(new errors.UnprocessableEntity('Username may not be an email'))
@set('nameLower', name.toLowerCase())
else