--
Ticket URL: <https://code.djangoproject.com/ticket/16617>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: me@… (added)
* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:1>
* status: new => assigned
* owner: nobody => version2beta
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:2>
* status: assigned => closed
* has_patch: 0 => 1
* resolution: => fixed
Comment:
Patch attached for django/core/validators.py that allows 'value' to remain
as its original type, rather than being converted to an integer length.
This allows the message to contain the string, or in the case of
MaxLengthValidator, the first limit_value chars of the string.
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:3>
* status: closed => reopened
* needs_better_patch: 0 => 1
* resolution: fixed =>
* needs_tests: 0 => 1
Comment:
Reopening ticket as the patch hasn't actually been committed, so the
ticket is not yet fixed.
I'm also not sure that the patch is likely to be accepted when reviewed by
a core dev as it's not immediately obvious how it resolves the problem and
there are no test cases to verify it is behaving correctly.
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:4>
Comment (by sperrygrove):
https://github.com/django/django/pull/2261
Makes value available to BaseValidator types for use in the validator
message.
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:6>
Comment (by timo):
Including `value` in the `params` dict looks good, but I wonder if it
might be better to leave the default error messages as is and either offer
an option to easily switch the default error message to include the value
or just let people override the message as they see fit. In the case of
really long values, it could be undesirable to have the value repeated in
the error message. Any thoughts?
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:7>
* status: new => assigned
* owner: version2beta => anonymous
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:8>
* owner: anonymous => sperrygrove
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:9>
Comment (by anubhav9042):
@sperrygrove
You interested in finishing this?
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:10>
Comment (by sperrygrove):
@anubhav9042 - please take it if you'd like to work on it.
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:11>
* owner: sperrygrove => anubhav9042
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
Comment:
https://github.com/django/django/pull/2958
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:12>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:13>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"5cdb8f8c1ea7161ca9e3b702ec7cdd7e3cd0999a"]:
{{{
#!CommitTicketReference repository=""
revision="5cdb8f8c1ea7161ca9e3b702ec7cdd7e3cd0999a"
Fixed #16617 -- Added 'value' to BaseValidator params.
Also allowed overriding the default messages in subclasses of
BaseValidator.
Thanks sperrygrove for initial patch.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/16617#comment:14>