Skip to content

Commit

Permalink
[1.1.X] Fixed #12239, again: Refined the original fix to avoid the te…
Browse files Browse the repository at this point in the history
…st 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
  • Loading branch information
kmtracey committed Mar 20, 2010
1 parent 8badb75 commit d5336b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django/db/models/fields/__init__.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -724,8 +724,9 @@ def get_db_prep_value(self, value):
return int(value) return int(value)


def get_db_prep_lookup(self, lookup_type, value): def get_db_prep_lookup(self, lookup_type, value):
if lookup_type == 'gte' or lookup_type == 'lt': if (lookup_type == 'gte' or lookup_type == 'lt') \
value = math.ceil(value) and isinstance(value, float):
value = math.ceil(value)
return super(IntegerField, self).get_db_prep_lookup(lookup_type, value) return super(IntegerField, self).get_db_prep_lookup(lookup_type, value)


def get_internal_type(self): def get_internal_type(self):
Expand Down

0 comments on commit d5336b2

Please sign in to comment.