Skip to content

Commit acf288a

Browse files
CelestialGurubckohan
authored andcommitted
Check if child node is Q instance
Oring Exists() subqeries together "Exists() | Exists()" creates a Q instance, but not one which has Q node children.
1 parent 0d820d0 commit acf288a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/polymorphic/query_translate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def tree_node_correct_field_specs(my_model, node):
7070
)
7171
if new_expr:
7272
node.children[i] = new_expr
73-
else:
73+
elif isinstance(child, models.Q):
7474
# this Q object child is another Q object, recursively process this as well
7575
tree_node_correct_field_specs(my_model, child)
7676

0 commit comments

Comments
 (0)