mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge pull request #907 from mewtaylor/issue/gh-872
Fix GH-872: Check for username before sending
This commit is contained in:
commit
243c579b49
1 changed files with 7 additions and 0 deletions
|
@ -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 + '/'
|
||||||
|
|
Loading…
Reference in a new issue