From 2f8ad4afdf21a5a7a03cbc5b136069de92de59f5 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Mon, 29 Aug 2016 14:16:15 -0700 Subject: [PATCH] Prevent email-formatted usernames on teacher signup --- app/views/teachers/CreateTeacherAccountView.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/teachers/CreateTeacherAccountView.coffee b/app/views/teachers/CreateTeacherAccountView.coffee index 8f1e103f7..d6eb6949c 100644 --- a/app/views/teachers/CreateTeacherAccountView.coffee +++ b/app/views/teachers/CreateTeacherAccountView.coffee @@ -136,6 +136,9 @@ module.exports = class CreateTeacherAccountView extends RootView if not error and not forms.validateEmail(trialRequestAttrs.email) forms.setErrorToProperty(form, 'email', 'invalid email') 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) forms.setErrorToProperty(form, 'educationLevel', 'include at least one') error = true