Prevent email-formatted usernames on teacher signup

This commit is contained in:
Scott Erickson 2016-08-29 14:16:15 -07:00
parent 0b3c7d3189
commit 2f8ad4afdf

View file

@ -136,6 +136,9 @@ module.exports = class CreateTeacherAccountView extends RootView
if not error and not forms.validateEmail(trialRequestAttrs.email) if not error and not forms.validateEmail(trialRequestAttrs.email)
forms.setErrorToProperty(form, 'email', 'invalid email') forms.setErrorToProperty(form, 'email', 'invalid email')
error = true error = true
if not error and forms.validateEmail(allAttrs.name)
forms.setErrorToProperty(form, 'name', 'username may not be an email')
error = true
if not _.size(trialRequestAttrs.educationLevel) if not _.size(trialRequestAttrs.educationLevel)
forms.setErrorToProperty(form, 'educationLevel', 'include at least one') forms.setErrorToProperty(form, 'educationLevel', 'include at least one')
error = true error = true