#32037: MinValueValidator, MaxValueValidator comparison is not compatible with
there messages
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  MishaGubsky                        |
                   Type:  Bug        |         Status:  new
              Component:  Core       |        Version:  3.1
  (Other)                            |       Keywords:  MinValueValidator,
               Severity:  Normal     |  MaxValueValidator, greater than or
           Triage Stage:             |  equal, less than or equal
  Unreviewed                         |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 The standard messages for MinValueValidator and MinLengthValidator don't
 appropriate the logic.

 {{{#!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.

-- 
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/054.e2c2d2b1eba94bee42d8ca192b452341%40djangoproject.com.

Reply via email to