summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-03-20 20:11:38 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-03-20 20:11:38 +0000
commitd5336b221c4aa086d011603375306a37edd4a8ac (patch)
treef83612065b6d4dc2d0cb67e7544670acdeeb0df5
parent8badb7587666127bf646a065ff58d84ed813c3ca (diff)
[1.1.X] Fixed #12239, again: Refined the original fix to avoid the test errors introduced. Thanks pmclanahan.
r12821 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12822 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/fields/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index e4e4f6cf24..f8be146826 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -724,8 +724,9 @@ class IntegerField(Field):
return int(value)
def get_db_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_db_prep_lookup(lookup_type, value)
def get_internal_type(self):