[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
This commit is contained in:
Karen Tracey 2010-03-20 20:11:38 +00:00
parent 8badb75876
commit d5336b221c
1 changed files with 3 additions and 2 deletions

View File

@ -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):