Code

Ticket #11116: 11116_proxy_model_delete2.diff

File 11116_proxy_model_delete2.diff, 673 bytes (added by samueladam, 5 years ago)

Filtering parent.values() for True objects

Line 
1Index: django/db/models/base.py
2===================================================================
3--- django/db/models/base.py    (revision 10781)
4+++ django/db/models/base.py    (working copy)
5@@ -538,7 +538,7 @@
6         # traversing to the most remote parent classes -- those with no parents
7         # themselves -- and then adding those instances to the collection. That
8         # will include all the child instances down to "self".
9-        parent_stack = self._meta.parents.values()
10+        parent_stack = filter(None, self._meta.parents.values())
11         while parent_stack:
12             link = parent_stack.pop()
13             parent_obj = getattr(self, link.name)