mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
FIX: js needs to use same max username length as server
This commit is contained in:
@ -197,7 +197,7 @@ export default Discourse.Controller.extend(Discourse.ModalFunctionality, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If too long
|
// If too long
|
||||||
if (this.get('accountUsername').length > 15) {
|
if (this.get('accountUsername').length > 20) {
|
||||||
return Discourse.InputValidation.create({
|
return Discourse.InputValidation.create({
|
||||||
failed: true,
|
failed: true,
|
||||||
reason: I18n.t('user.username.too_long')
|
reason: I18n.t('user.username.too_long')
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<tr class="input">
|
<tr class="input">
|
||||||
<td class="label"><label for='new-account-username'>{{i18n user.username.title}}</label></td>
|
<td class="label"><label for='new-account-username'>{{i18n user.username.title}}</label></td>
|
||||||
<td>
|
<td>
|
||||||
{{input value=accountUsername id="new-account-username" maxlength="15"}}
|
{{input value=accountUsername id="new-account-username" maxlength="20"}}
|
||||||
{{input-tip validation=usernameValidation}}
|
{{input-tip validation=usernameValidation}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -10,7 +10,7 @@ test('basicUsernameValidation', function() {
|
|||||||
|
|
||||||
testInvalidUsername('', undefined);
|
testInvalidUsername('', undefined);
|
||||||
testInvalidUsername('x', I18n.t('user.username.too_short'));
|
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');
|
var controller = controllerFor('create-account');
|
||||||
controller.set('accountUsername', 'porkchops');
|
controller.set('accountUsername', 'porkchops');
|
||||||
|
Reference in New Issue
Block a user