Skip to content

Commit f62c157

Browse files
committed
Remove Integer overflow checks, it was already managed by process_rhs.
1 parent 95c94e0 commit f62c157

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

django_mongodb/lookups.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
BuiltinLookup,
66
Contains,
77
Exact,
8-
IntegerFieldOverflow,
98
IsNull,
109
)
1110
from django.db.models.sql.where import AND, XOR, WhereNode
@@ -71,19 +70,6 @@ def exact(self, compiler, connection):
7170
return {"$expr": {"$eq": [lhs_mql, value]}}
7271

7372

74-
def integer_field_overflow(self, compiler, connection):
75-
rhs = self.rhs
76-
if isinstance(rhs, int):
77-
field_internal_type = self.lhs.output_field.get_internal_type()
78-
min_value, max_value = connection.ops.integer_field_range(field_internal_type)
79-
if min_value is not None and rhs < min_value:
80-
raise self.underflow_exception
81-
if max_value is not None and rhs > max_value:
82-
raise self.overflow_exception
83-
84-
return super(IntegerFieldOverflow, self).as_mql(compiler, connection)
85-
86-
8773
def contains(self, compiler, connection):
8874
lhs_mql = process_lhs(self, compiler, connection)
8975
value = process_rhs(self, compiler, connection)
@@ -117,5 +103,4 @@ def register_lookups():
117103
Contains.as_mql = contains
118104
In.as_mql = in_
119105
RelatedIn.as_mql = in_
120-
IntegerFieldOverflow.as_mql = integer_field_overflow
121106
BuiltinLookup.as_mql = builtin_lookup

0 commit comments

Comments
 (0)