#36809: Allow EmailValidator to customize error messages depending on the part
that
failed validation
-------------------------------------+-------------------------------------
Reporter: Daniel E Onetti | Owner: jaffar
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: EmailValidator | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by jaffar Khan):
Thanks Mike for the review. I think defining subclass is not a good option
which makes duplication of code as you describe. Defining explicit methods
like I did will makes the code more readable and will avoid duplication.
In my current PR I made some changes like the methods
**validate_domain()** and **validate_username()** will return boolean so
we need to wrap the methods inside **__call__**. Now I am confused about
do I have to make these two methods to raise **ValidationError** then no
need for wrapping inside **__call__** or left as it is?
--
Ticket URL: <https://code.djangoproject.com/ticket/36809#comment:13>
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/0107019c18053685-4c4435cb-4977-493c-b13e-c86814791ee8-000000%40eu-central-1.amazonses.com.