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:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							ea7542891a
						
					
				
				
					commit
					780bddf75b
				
			| @@ -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( | ||||
|   | ||||
| @@ -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.@+-]+$', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user