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