Merge pull request #907 from mewtaylor/issue/gh-872

Fix GH-872: Check for username before sending
This commit is contained in:
Matthew Taylor 2016-09-02 12:52:55 -04:00 committed by GitHub
commit 243c579b49

View file

@ -91,6 +91,13 @@ module.exports = {
},
validateUsername: function (username, callback) {
callback = callback || function () {};
if (!username) {
this.refs.form.refs.formsy.updateInputsWithError({
'user.username': formatMessage({id: 'teacherRegistration.validationRequired'})
});
return callback(false);
}
api({
host: '',
uri: '/accounts/check_username/' + username + '/'