#34961: Add a max_length parameter to EmailValidator -------------------------------------+------------------------------------- Reporter: jecarr | Owner: nobody Type: | Status: closed Cleanup/optimization | Component: Core (Other) | Version: 4.2 Severity: Normal | Resolution: wontfix Keywords: | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by jecarr): Thanks for the quick reply and solution! You are correct with my use case and your solution would apply to my scenario. (I'm validating a non-Django-Field variable, a string.) I initially raised the ticket because `EmailField` has a max-length of 254 and `EmailValidator` has a max-length of 320. (I am aware this is not a bug as all is still working.) My intention was to have consistency with these two so within the Django codebase - regardless of my codebase/other applications - it does not look like two different max-lengths for email addresses are suggested. Additionally, I thought of others who may also want consistency with having max-lengths of 254 elsewhere in their application only to use Django's EmailValidator separately (not on an EmailField) to find longer email addresses accepted. I did wonder if the two different max-lengths were unintentional and thought an approach would be to drop the EmailValidator max-length to match that of EmailField's max-length or vice-versa. But I appreciate this could cause breaking changes to existing applications hence my initial suggestion. As this is now a wontfix and for my understanding of the codebase, I'll ask why the two different max-lengths for email addresses? Is it because with Fields we want to be stricter with max-lengths? -- Ticket URL: <https://code.djangoproject.com/ticket/34961#comment:2> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018bb8dcd046-5aed4983-7174-4892-887d-8db74f03146c-000000%40eu-central-1.amazonses.com.