FIX: js needs to use same max username length as server

This commit is contained in:
Neil Lalonde 2014-06-09 15:27:37 -04:00
parent faed17aa18
commit 78d46a81e1
3 changed files with 3 additions and 3 deletions

View File

@ -197,7 +197,7 @@ export default Discourse.Controller.extend(Discourse.ModalFunctionality, {
}
// If too long
if (this.get('accountUsername').length > 15) {
if (this.get('accountUsername').length > 20) {
return Discourse.InputValidation.create({
failed: true,
reason: I18n.t('user.username.too_long')

View File

@ -30,7 +30,7 @@
<tr class="input">
<td class="label"><label for='new-account-username'>{{i18n user.username.title}}</label></td>
<td>
{{input value=accountUsername id="new-account-username" maxlength="15"}}
{{input value=accountUsername id="new-account-username" maxlength="20"}}
&nbsp;{{input-tip validation=usernameValidation}}
</td>
</tr>

View File

@ -10,7 +10,7 @@ test('basicUsernameValidation', function() {
testInvalidUsername('', undefined);
testInvalidUsername('x', I18n.t('user.username.too_short'));
testInvalidUsername('1234567890123456', I18n.t('user.username.too_long'));
testInvalidUsername('123456789012345678901', I18n.t('user.username.too_long'));
var controller = controllerFor('create-account');
controller.set('accountUsername', 'porkchops');