Skip to content

Commit

Permalink
fix missing not in is not for replacing != in type comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
larsschwegmann committed Oct 1, 2024
1 parent 79672d7 commit ff886d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tortoise/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def resolver_arithmetic_expression(
left_field_object,
) = cls.resolver_arithmetic_expression(model, left)
if left_field_object:
if field_object and type(field_object) is type(left_field_object):
if field_object and type(field_object) is not type(left_field_object):
raise FieldError(
"Cannot use arithmetic expression between different field type"
)
Expand All @@ -82,7 +82,7 @@ def resolver_arithmetic_expression(
right_field_object,
) = cls.resolver_arithmetic_expression(model, right)
if right_field_object:
if field_object and type(field_object) is type(right_field_object):
if field_object and type(field_object) is not type(right_field_object):
raise FieldError(
"Cannot use arithmetic expression between different field type"
)
Expand Down

0 comments on commit ff886d7

Please sign in to comment.