544 | | parent_obj = getattr(self, link.name) |
545 | | if parent_obj._meta.parents: |
546 | | parent_stack.extend(parent_obj._meta.parents.values()) |
547 | | continue |
548 | | # At this point, parent_obj is base class (no ancestor models). So |
549 | | # delete it and all its descendents. |
550 | | parent_obj._collect_sub_objects(seen_objs) |
| 544 | if link is not None: |
| 545 | parent_obj = getattr(self, link.name) |
| 546 | if parent_obj._meta.parents: |
| 547 | parent_stack.extend(parent_obj._meta.parents.values()) |
| 548 | continue |
| 549 | # At this point, parent_obj is base class (no ancestor models). So |
| 550 | # delete it and all its descendents. |
| 551 | parent_obj._collect_sub_objects(seen_objs) |