1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #34473 -- Fixed step validation for form fields with non-zero minimum value.

This commit is contained in:
Jacob Rief
2023-04-08 22:10:17 +02:00
committed by Mariusz Felisiak
parent 549d6ffeb6
commit 1fe0b167af
9 changed files with 129 additions and 8 deletions

View File

@@ -316,7 +316,9 @@ class IntegerField(Field):
if min_value is not None:
self.validators.append(validators.MinValueValidator(min_value))
if step_size is not None:
self.validators.append(validators.StepValueValidator(step_size))
self.validators.append(
validators.StepValueValidator(step_size, offset=min_value)
)
def to_python(self, value):
"""