Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.7.x] Fixed field deconstruction tests failures introduced by 1506c71.

refs #12030.

Backport of ff874f3 from master
  • Loading branch information...
commit 81d3d48b5ed841414c1d91743aea23dab36c8b4b 1 parent 78211b1
@charettes charettes authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/db/models/fields/__init__.py
View
7 django/db/models/fields/__init__.py
@@ -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):
Please sign in to comment.
Something went wrong with that request. Please try again.