diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2014-05-08 21:38:56 -0700 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2014-05-08 21:39:31 -0700 |
| commit | 1e8b1db050de72edc3c434e6e5d5dd55ae78ae2e (patch) | |
| tree | 1347c58b78aab1796c7342c05ab0bb36eceeedde | |
| parent | 4535dedc42b90b8f75576e48a12e2e63d4e93048 (diff) | |
[1.7.x] Fixed #22325: Ignore __first__ dependencies to your own app
| -rw-r--r-- | django/db/migrations/loader.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index 0cf2c59402..661f74ff97 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -201,7 +201,10 @@ class MigrationLoader(object): # makemigrations to declare dependencies on apps before they # even have migrations. if parent[1] == "__first__" and parent not in self.graph: - if parent[0] in self.unmigrated_apps: + if parent[0] == key[0]: + # Ignore __first__ references to the same app (#22325) + continue + elif parent[0] in self.unmigrated_apps: # This app isn't migrated, but something depends on it. # The models will get auto-added into the state, though # so we're fine. |
