diff options
| author | Loic Bistuer <loic.bistuer@gmail.com> | 2014-03-25 22:02:51 +0800 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-03-25 10:34:28 -0400 |
| commit | bf69375c4d2eaec4f00c646b9e7e84a9397d1a20 (patch) | |
| tree | dde8f2037ade7c5b060a71c05c5e36ef5e924980 /django | |
| parent | ddcbde41eec12f7a84b00635cdbf1c93d4e4d297 (diff) | |
[1.7.x] Fixed #22331 -- Fixed migrations ProjectState to ignore unmanaged models.
Backport of 69d4b1c3ea from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/state.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/migrations/state.py b/django/db/migrations/state.py index ab2bd8e6d8..01019ff980 100644 --- a/django/db/migrations/state.py +++ b/django/db/migrations/state.py @@ -58,8 +58,9 @@ class ProjectState(object): "Takes in an Apps and returns a ProjectState matching it" app_models = {} for model in apps.get_models(): - model_state = ModelState.from_model(model) - app_models[(model_state.app_label, model_state.name.lower())] = model_state + if model._meta.managed: + model_state = ModelState.from_model(model) + app_models[(model_state.app_label, model_state.name.lower())] = model_state return cls(app_models) def __eq__(self, other): |
