Fix duplicate email on account creation

This commit is contained in:
Alexandre Iooss 2021-10-15 13:37:15 +02:00
parent d2fa5ce02f
commit 0d0f72a9eb

View file

@ -17,7 +17,7 @@ class CustomSignupForm(SignupForm):
""" """
Check that the email address ends with a trusted domain. Check that the email address ends with a trusted domain.
""" """
email = self.cleaned_data.get("email") email = super().clean_email()
if not email.endswith("@crans.org") and not email.endswith("@ens-paris-saclay.fr"): if not email.endswith("@crans.org") and not email.endswith("@ens-paris-saclay.fr"):
raise forms.ValidationError( raise forms.ValidationError(
_("Must end with `@crans.org` or `@ens-paris-saclay.fr`.") _("Must end with `@crans.org` or `@ens-paris-saclay.fr`.")