def clean_username(self, username): print('THIS IS A TEST OF CLEAN USERNAME') if len(username) > 0: raise ValidationError( 'Please enter a username value less than the current one') return DefaultAccountAdapter.clean_username( self, username) # For other default validations.
def clean_username(self, username): if len(username) > USERNAME_MAX_LENGTH: raise ValidationError( f'Please enter a username less than {USERNAME_MAX_LENGTH + 1}') # For other default validations. return DefaultAccountAdapter.clean_username(self, username)
def clean_username(self, username, shallow=None): print("aaaa", type(len(username))) if len(username) > 30: raise ValidationError( 'Please enter a username value less than the current one') # For other default validations. return DefaultAccountAdapter.clean_username(self, username)
def clean_username(self, username, shallow=False): zh_pattern = re.compile(u'[\u4e00-\u9fa5]+') username = str(username) result = zh_pattern.search(username) if result: raise forms.ValidationError(('用户名不能为中文'),code = 'invalid') return DefaultAccountAdapter.clean_username(self, username, shallow=shallow)
def clean_username(self, username): if len(username) > 20: raise ValidationError( 'Please enter a username value less than the current one') return DefaultAccountAdapter.clean_username(self, username) # class RestrictEmailAdapter(DefaultAccountAdapter): # def clean_email(self,email): # RestrictedList = ['Your restricted list goes here.'] # if email in RestrictedList # raise ValidationError('You are restricted from registering. Please contact admin.') # return email
def clean_username(self, username): if len(username) > 8: raise ValidationError( 'Please enter a username value less than the current one') # For other default validations. return DefaultAccountAdapter.clean_username(self, username)
def clean_username(self, username, shallow=False): if len(username) >= 15: raise ValidationError( 'Please enter a username less than 15 characters') return DefaultAccountAdapter.clean_username( self, username) # For other default validations.
def clean_username(self, username): if len(username) > settings.USERNAME_MAX_LENGTH: raise ValidationError('Max username length is eight charactors') # For other default validations. return DefaultAccountAdapter.clean_username(self, username)
def clean_username(self, username): if len(username) > 10: raise ValidationError( "Please enter an username of maximum 10 characters") return DefaultAccountAdapter.clean_username(self, username)