1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #20846 -- Decreased User.username max_length to 150 characters.

This commit is contained in:
Collin Anderson
2015-12-29 14:52:48 -05:00
committed by Tim Graham
parent ea7542891a
commit 780bddf75b
4 changed files with 21 additions and 7 deletions

View File

@@ -17,8 +17,8 @@ class Migration(migrations.Migration):
name='username',
field=models.CharField(
error_messages={'unique': 'A user with that username already exists.'},
help_text='Required. 254 characters or fewer. Letters, digits and @/./+/-/_ only.',
max_length=254,
help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
max_length=150,
unique=True,
validators=[
django.core.validators.RegexValidator(

View File

@@ -303,9 +303,9 @@ class AbstractUser(AbstractBaseUser, PermissionsMixin):
"""
username = models.CharField(
_('username'),
max_length=254,
max_length=150,
unique=True,
help_text=_('Required. 254 characters or fewer. Letters, digits and @/./+/-/_ only.'),
help_text=_('Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.'),
validators=[
validators.RegexValidator(
r'^[\w.@+-]+$',