#36809: Allow EmailValidator to return 'domain_part' in ValidationError params
---------------------------------+-----------------------------------------
Reporter: Daniel E Onetti | Type: Uncategorized
Status: new | Component: Core (Other)
Version: dev | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------------------------
Currently, the EmailValidator only provides the full 'value' in the params
dictionary when a ValidationError is raised. However, in many use cases,
developers need to customize error messages based specifically on the
domain part of the email (e.g., "The domain %(domain_part)s is not
allowed").
This change adds 'domain_part' to the params dictionary in
EmailValidator.__call__, bringing it in line with how other validators
provide decomposed parts of the validated value. This allows for more
granular and helpful error messages for end users.
I have already prepared a patch with tests and verified that it passes all
style (flake8) and functional checks.
--
Ticket URL: <https://code.djangoproject.com/ticket/36809>
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019b32aa6fd7-6729921c-f3dc-410b-bca8-288a984ac2de-000000%40eu-central-1.amazonses.com.