1
0
mirror of https://github.com/django/django.git synced 2025-10-27 23:56:08 +00:00

Fixed #22331 -- Fixed migrations ProjectState to ignore unmanaged models.

This commit is contained in:
Loic Bistuer
2014-03-25 22:02:51 +08:00
committed by Tim Graham
parent 86dcac4634
commit 69d4b1c3ea
2 changed files with 14 additions and 2 deletions

View File

@@ -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):