mirror of https://github.com/django/django.git
Fixed #32970 -- Changed WhereNode.clone() to create a shallow copy of children.
This commit is contained in:
parent
ef4ef3b8f5
commit
e441847eca
|
@ -146,12 +146,9 @@ class WhereNode(tree.Node):
|
||||||
value) tuples, or objects supporting .clone().
|
value) tuples, or objects supporting .clone().
|
||||||
"""
|
"""
|
||||||
clone = self.__class__._new_instance(
|
clone = self.__class__._new_instance(
|
||||||
children=[], connector=self.connector, negated=self.negated)
|
children=None, connector=self.connector, negated=self.negated,
|
||||||
for child in self.children:
|
)
|
||||||
if hasattr(child, 'clone'):
|
clone.children = self.children[:]
|
||||||
clone.children.append(child.clone())
|
|
||||||
else:
|
|
||||||
clone.children.append(child)
|
|
||||||
return clone
|
return clone
|
||||||
|
|
||||||
def relabeled_clone(self, change_map):
|
def relabeled_clone(self, change_map):
|
||||||
|
|
Loading…
Reference in New Issue