{{{#!python
@deconstructible
class MaxValueValidator(BaseValidator):
message = _('Ensure this value is less than or equal to
%(limit_value)s.')
code = 'max_value'
def compare(self, a, b):
return a > b
class MinValueValidator(BaseValidator):
message = _('Ensure this value is greater than or equal to
%(limit_value)s.')
code = 'min_value'
def compare(self, a, b):
return a < b
}}}
According to MinValueValidator and MaxValueValidator are inherited by
other validators, the simplest way to fix this is to update the error
message.
As an improvement will be great to have the validators without strong
comparison.
--
Ticket URL: <https://code.djangoproject.com/ticket/32037>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
As far as I'm aware,
[https://github.com/django/django/blob/01974d7f7549b2dca2a729c3c1a1ea7d4585eb3a/django/core/validators.py#L342-L343
the code] is correct as is. You can check the
[https://github.com/django/django/blob/01974d7f7549b2dca2a729c3c1a1ea7d4585eb3a/tests/validators/tests.py#L189
tests].
--
Ticket URL: <https://code.djangoproject.com/ticket/32037#comment:2>