mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-04 06:06:19 +01:00
Prevent space from being in username during registration
This commit is contained in:
@@ -9,6 +9,9 @@ class RegistrationForm(forms.Form):
|
||||
email_again = forms.CharField(max_length=254, required=True, label="Email Again")
|
||||
|
||||
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 self.cleaned_data['password'] != self.cleaned_data['password_again']:
|
||||
raise forms.ValidationError(u'Passwords do not match')
|
||||
|
||||
Reference in New Issue
Block a user