1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #29897 -- Fixed autodetector's swappable MTI dependency resolution.

Thanks Steven Ganz for the detailed report.
This commit is contained in:
Simon Charette
2018-10-28 18:21:25 -04:00
committed by Tim Graham
parent 82353ef940
commit d8e03fdeb9
2 changed files with 15 additions and 0 deletions

View File

@@ -345,6 +345,9 @@ class MigrationAutodetector:
dependency_graph = {op: set() for op in ops}
for op in ops:
for dep in op._auto_deps:
# Resolve intra-app dependencies to handle circular
# references involving a swappable model.
dep = self._resolve_dependency(dep)[0]
if dep[0] == app_label:
for op2 in ops:
if self.check_dependency(op2, dep):