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) { validateUsername: function (username, callback) {
callback = callback || function () {}; callback = callback || function () {};
if (!username) {
this.refs.form.refs.formsy.updateInputsWithError({
'user.username': formatMessage({id: 'teacherRegistration.validationRequired'})
});
return callback(false);
}
api({ api({
host: '', host: '',
uri: '/accounts/check_username/' + username + '/' uri: '/accounts/check_username/' + username + '/'