Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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: http://code.djangoproject.com/svn/django/trunk@8807 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7ecdf47bd03c81fcea896fea4644c05aa28a0e57 1 parent d7e9bb0
Jacob Kaplan-Moss authored September 01, 2008

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  django/db/models/query.py
2  django/db/models/query.py
@@ -95,6 +95,8 @@ def ordered_keys(self):
95 95
         while len(dealt_with) < len(models):
96 96
             found = False
97 97
             for model in models:
  98
+                if model in dealt_with:
  99
+                    continue
98 100
                 children = self.children.setdefault(model, [])
99 101
                 if len([c for c in children if c not in dealt_with]) == 0:
100 102
                     dealt_with[model] = None

0 notes on commit 7ecdf47

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