#35693: Password validators aren't callable
-------------------------------------+-------------------------------------
Reporter: iamkorniichuk | Owner: Antoliny
Type: | Status: closed
Cleanup/optimization |
Component: contrib.auth | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: validators password | Triage Stage: Accepted
callable |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):
* cc: Ryan Hiebert (added)
* resolution: => wontfix
* status: assigned => closed
Comment:
By default validating fields use this syntax validator(value) but password
validators don’t implement `.__call__()`. Therefore making them unusable
outside of `validate_password()`.
As Ryan pointed out in the forum discussion, these are not “unusable
outside `validate_password()`” as they can be used with:
{{{
CharField(..., validators=[MinimumLengthValidator().validate]
}}}
Those that need a `user` will pass silently when a `user` is not passed
(adding a `.__call__()` doesn’t change that).
So I think the problem this wanted to solve “make them usable outside
`validate_password()`” is not really a problem and, as this was accepted
to solve this, I will close this ticket as `wontfix`.
In the forum I think there were good ideas and thoughts around the
direction of validators and password validators. I think these thoughts
need more time to crystalize before we jump into making a change here.
Once there is a solid proposal with support from the community, that
should probably be a new ticket (as I imagine it might be more than just
adding `__call__`).
--
Ticket URL: <https://code.djangoproject.com/ticket/35693#comment:10>
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/01070193b56ed71a-b55157b8-cc22-433d-b72f-26c0d77dbfb2-000000%40eu-central-1.amazonses.com.