Opened 23 months ago
Closed 23 months ago
#34503 closed Bug (invalid)
Missleading message in MinValueValidator and MaxValueValidator
Description ¶
Here is a message error for MaxValueValidator:
message = _("Ensure this value is less than or equal to %(limit_value)s.")
but compare method checks if a < b. So it's not accurate comparision or message, It should checks a <= b, isn't it?
The same for MinValueValidator
Change History (2)
comment:1 by , 23 months ago
Easy pickings: | set |
---|
comment:2 by , 23 months ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Sorry I think you may have misread the code.
Here is MaxValueValidator:
Here a is the cleaned value while b is the limit. If compare is True then a ValidationError is raised. The inverse of this comparison is therefore correct: cleaned value must be less than or equal to the limit.