Fixed field deconstruction tests failures introduced by 1506c71a95.

refs #12030.
This commit is contained in:
Simon Charette 2014-03-25 16:02:53 -04:00 committed by Tim Graham
parent 42336c84a0
commit ff874f363c
1 changed files with 4 additions and 3 deletions

View File

@ -1562,13 +1562,14 @@ class IntegerField(Field):
description = _("Integer")
def __init__(self, *args, **kwargs):
field_validators = kwargs.setdefault('validators', [])
default_validators = self.default_validators[:]
internal_type = self.get_internal_type()
min_value, max_value = connection.ops.integer_field_range(internal_type)
if min_value is not None:
field_validators.append(validators.MinValueValidator(min_value))
default_validators.append(validators.MinValueValidator(min_value))
if max_value is not None:
field_validators.append(validators.MaxValueValidator(max_value))
default_validators.append(validators.MaxValueValidator(max_value))
self.default_validators = default_validators
super(IntegerField, self).__init__(*args, **kwargs)
def get_prep_value(self, value):