New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E-mail field checked twice for correct format #238
Comments
Hi, I'm experiencing the same issue on my project, any luck in resolving it? Thanks! |
I've created a minimal example to demonstrate the error and maybe analyse it: https://github.com/christianwgd/django_registration_issue_238 |
I'll try to figure this out. Unfortunately, Django's validators aren't really designed for two validators to both error with the same error message :/ |
Hey, thanks for bothering. To me it seems like the HTML5 validator doesn't do a more accurate check on the email address than the standard django email validator. But maybe I don't fully understand, what the purpose of the HTML5 validator is. |
My current workaround for this is to remove the django email validator from the list of validators, since it seems to have a more strict regex. |
The main point of the HTML5 validator, for this specific app, is to ensure that no "valid" email address value is ever accepted which contains more than one I also prefer the HTML5 validator's regex because it gets uniformity across the frontend and backend -- django-registration enforces the same thing an HTML5 |
Also I'm mildly curious to know how this is getting around the client-side validation -- since it's an |
So you think the right way to go is what I've done in my workaround and use only the HTML5 validator and remove the standard django validator? As far as I've tested this seems to be a sufficient fix. |
I think that might be what ends up happening. I'm thinking through what will be in the next release right now (there are a couple other things I want to get in), as well as whether it's time to start planning a major version bump at some point to try to handle yet more custom-user edge cases... |
So as @christianwgd suggested, the least-breaking thing to do here is just to not apply the default Django validator. I've pushed a commit which makes that change, and it'll be included in the next release (3.4), due out Soon™. Note that this is, amusingly, not a backwards-incompatible change because it doesn't change the set of accepted addresses. |
django-registration 3.4 has been released, containing this fix. |
Hi, when I enter an invalid email address during registration, I get the error message "Enter a valid email address" twice.
I digged a little bit deeper and found that one comes from the standard django email validator (django.core.validators.EmailValidator) and the other one is added by the HTML5EmailValidator (django_registration.validators.HTML5EmailValidator).
Using Python3.10, Django 4.1.7 and django_registration 3.3
The text was updated successfully, but these errors were encountered: