Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #8115: avoid a infiniate loop when collecting related objects f…

…or 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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent d7e9bb0 commit 7ecdf47bd03c81fcea896fea4644c05aa28a0e57 @jacobian jacobian committed
Showing with 2 additions and 0 deletions.
  1. +2 −0  django/db/models/
2  django/db/models/
@@ -95,6 +95,8 @@ def ordered_keys(self):
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

0 comments on commit 7ecdf47

Please sign in to comment.
Something went wrong with that request. Please try again.