1616 UserAchievementManager ,
1717 LikesOnProjectManager ,
1818)
19- from users .validators import user_birthday_validator
19+ from users .validators import user_birthday_validator , user_name_validator
2020
2121
2222def get_default_user_type ():
@@ -58,8 +58,8 @@ class CustomUser(AbstractUser):
5858
5959 username = None
6060 email = models .EmailField (unique = True )
61- first_name = models .CharField (max_length = 255 )
62- last_name = models .CharField (max_length = 255 )
61+ first_name = models .CharField (max_length = 255 , validators = [ user_name_validator ] )
62+ last_name = models .CharField (max_length = 255 , validators = [ user_name_validator ] )
6363 password = models .CharField (max_length = 255 )
6464 is_active = models .BooleanField (default = False , editable = False )
6565 user_type = models .PositiveSmallIntegerField (
@@ -71,7 +71,9 @@ class CustomUser(AbstractUser):
7171 default = 0 ,
7272 editable = False ,
7373 )
74- patronymic = models .CharField (max_length = 255 , null = True , blank = True )
74+ patronymic = models .CharField (
75+ max_length = 255 , validators = [user_name_validator ], null = True , blank = True
76+ )
7577 key_skills = models .CharField (max_length = 512 , null = True , blank = True )
7678 avatar = models .URLField (null = True , blank = True )
7779 birthday = models .DateField (
0 commit comments