mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Prevent space from being in username during registration
This commit is contained in:
parent
9f0047b3a7
commit
dbcade4146
@ -9,6 +9,9 @@ class RegistrationForm(forms.Form):
|
|||||||
email_again = forms.CharField(max_length=254, required=True, label="Email Again")
|
email_again = forms.CharField(max_length=254, required=True, label="Email Again")
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
if ' ' in self.cleaned_data['username']:
|
||||||
|
raise forms.ValidationError(u'Username can not contain a space')
|
||||||
|
|
||||||
if 'password' in self.cleaned_data and 'password_again' in self.cleaned_data:
|
if 'password' in self.cleaned_data and 'password_again' in self.cleaned_data:
|
||||||
if self.cleaned_data['password'] != self.cleaned_data['password_again']:
|
if self.cleaned_data['password'] != self.cleaned_data['password_again']:
|
||||||
raise forms.ValidationError(u'Passwords do not match')
|
raise forms.ValidationError(u'Passwords do not match')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user