#31806: Make validators include the provided value in ValidationError
----------------------------------------+------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: master
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 |
----------------------------------------+------------------------
It is sometimes desirable to include the provide value in a custom error
message. For example:
{{{
“blah” is not a valid email.
}}}
By making built-in validators provide `value` to `ValidationError`, one
can override an error message and use a `%(value)s` placeholder.
This placeholder `value` matches an example already in the docs:
https://docs.djangoproject.com/en/3.0/ref/validators/#writing-validators
--
Ticket URL: <https://code.djangoproject.com/ticket/31806>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/052.7e70665367721861629188db56f2702e%40djangoproject.com.