Commit 1d793461 authored by Noe Nieto's avatar Noe Nieto 💬

convert userid and recovery email to lowercase to avoid problems like Purism/LibremOne/task#357

parent f76fe7b7
......@@ -69,6 +69,9 @@ class CartRegistrationForm(RegistrationForm):
super(CartRegistrationForm, self).__init__(*args, **kwargs)
self.fields['username'].validators.append(validate_reserved_names)
def clean_email(self):
return self.cleaned_data['email'].lower()
class CartRegistrationFormWithCaptcha(CartRegistrationForm):
captcha = CaptchaField(
......
......@@ -88,6 +88,10 @@ class User(AbstractUser):
default=AccountType.UNDEFINED)
billing_email = models.EmailField(default='', null=False)
def clean(self):
super().clean()
self.email = self.email.lower()
@classmethod
def normalize_username(cls, username):
username = super(User, cls).normalize_username(username)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment