Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #12239, again: Refined the original fix to avoid the test error…

…s introduced. Thanks pmclanahan.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 10884ec2ebee152350c661c1356519ecd21084a5 1 parent 9150fb6
@kmtracey kmtracey authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/db/models/fields/
7 django/db/models/fields/
@@ -579,7 +579,7 @@ def to_python(self, value):
def get_prep_value(self, value):
return self.to_python(value)
def formfield(self, **kwargs):
# Passing max_length to forms.CharField means that the value's length
# will be validated twice. This is considered acceptable since we want
@@ -884,8 +884,9 @@ def get_prep_value(self, value):
return int(value)
def get_prep_lookup(self, lookup_type, value):
- if lookup_type == 'gte' or lookup_type == 'lt':
- value = math.ceil(value)
+ if (lookup_type == 'gte' or lookup_type == 'lt') \
+ and isinstance(value, float):
+ value = math.ceil(value)
return super(IntegerField, self).get_prep_lookup(lookup_type, value)
def get_internal_type(self):
Please sign in to comment.
Something went wrong with that request. Please try again.