def clean_username(self): username = self.cleaned_data['username'] if not verify_username(self.cleaned_data['username']): raise forms.ValidationError(MESSAGES['INVALID_USERNAME']) if User.objects.filter(username=username).count(): raise forms.ValidationError(MESSAGES["USERNAME_TAKEN"].format(username=username)) return username
def clean_username(self): username = self.cleaned_data['username'] if not verify_username(self.cleaned_data['username']): raise forms.ValidationError(MESSAGES['INVALID_USERNAME']) if User.objects.filter(username=username).count(): raise forms.ValidationError( MESSAGES["USERNAME_TAKEN"].format(username=username)) return username
def clean_username(self): username = self.cleaned_data["username"] if not verify_username(username): raise forms.ValidationError(MESSAGES['INVALID_USERNAME']) if User.objects.filter(username=username).count(): raise forms.ValidationError( "This username is taken. Try one of {0}_1 through {0}_10." .format(username)) return username
def clean_username(self): username = self.cleaned_data["username"] if not verify_username(username): raise forms.ValidationError(MESSAGES['INVALID_USERNAME']) if User.objects.filter(username=username).count(): raise forms.ValidationError( "This username is taken. Try one of {0}_1 through {0}_10.". format(username)) return username
def clean_username(self): username = self.cleaned_data["username"] if not verify_username(username): raise forms.ValidationError(MESSAGES['INVALID_USERNAME']) return username