From 780bddf75b93784470a2e352ed44ee35a751d667 Mon Sep 17 00:00:00 2001 From: Collin Anderson Date: Tue, 29 Dec 2015 14:52:48 -0500 Subject: Fixed #20846 -- Decreased User.username max_length to 150 characters. --- django/contrib/auth/migrations/0008_alter_user_username_max_length.py | 4 ++-- django/contrib/auth/models.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'django') diff --git a/django/contrib/auth/migrations/0008_alter_user_username_max_length.py b/django/contrib/auth/migrations/0008_alter_user_username_max_length.py index 56705fa58f..2afbc30c2a 100644 --- a/django/contrib/auth/migrations/0008_alter_user_username_max_length.py +++ b/django/contrib/auth/migrations/0008_alter_user_username_max_length.py @@ -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( diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index dfa76977d7..0600b96774 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -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.@+-]+$', -- cgit v1.3