1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

Fixed #23275: Unmanaged models kept by autodetector, ignored by ops

This commit is contained in:
Andrew Godwin
2014-08-12 12:49:20 -07:00
parent 6745b6fd7a
commit 8f9862cd4d
4 changed files with 90 additions and 25 deletions

View File

@@ -101,12 +101,13 @@ class Operation(object):
def allowed_to_migrate(self, connection_alias, model):
"""
Returns if we're allowed to migrate the model. Checks the router,
if it's a proxy, and if it's swapped out.
if it's a proxy, if it's managed, and if it's swapped out.
"""
return (
router.allow_migrate(connection_alias, model) and
not model._meta.proxy and
not model._meta.swapped
not model._meta.swapped and
model._meta.managed
)
def __repr__(self):