mirror of
https://github.com/django/django.git
synced 2025-10-28 08:06:09 +00:00
Fixed #22331 -- Made MigrationAutodetector ignore unmanaged models.
This commit reverts 69d4b1c and tackle the issue from a different angle.
Models remain present in the project state, but are now ignored by the
autodetector.
This commit is contained in:
@@ -58,9 +58,8 @@ class ProjectState(object):
|
||||
"Takes in an Apps and returns a ProjectState matching it"
|
||||
app_models = {}
|
||||
for model in apps.get_models():
|
||||
if model._meta.managed:
|
||||
model_state = ModelState.from_model(model)
|
||||
app_models[(model_state.app_label, model_state.name.lower())] = model_state
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user