summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-09-01 19:35:03 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-09-01 19:35:03 +0000
commit7ecdf47bd03c81fcea896fea4644c05aa28a0e57 (patch)
tree2ed2ae16b8d2275f491dbce40b03356e22052d7a
parentd7e9bb0571a51e4c26e525c8539c510418f670d3 (diff)
Fixed #8115: avoid a infiniate loop when collecting related objects for deletion.
I can't reproduce the original error leading to #8115 and the patch. However, the only harm this change could cause is to raise more `CyclicDependency` exceptions than strictly necessary. That's better than infinite loops, at least, and it's easier to clean up in the future when we figure out the actual fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8807 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/query.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 4fe185ed6e..b08f3acd14 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -95,6 +95,8 @@ class CollectedObjects(object):
while len(dealt_with) < len(models):
found = False
for model in models:
+ if model in dealt_with:
+ continue
children = self.children.setdefault(model, [])
if len([c for c in children if c not in dealt_with]) == 0:
dealt_with[model] = None