summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMatthew Schinckel <matt@schinckel.net>2016-03-02 14:40:46 +1030
committerTim Graham <timograham@gmail.com>2016-03-02 13:54:27 -0500
commit60633ef3dec8421706c610d8238af2cd679fc915 (patch)
tree33933ade6fbdb3e6921d4c79d0bfeef79cdf0448 /django
parent5155c2b4587629c4bc77a11846e5b9d3ba5a43ef (diff)
Fixed #26304 -- Ignored unmanaged through model in table introspection.
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/base/introspection.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/backends/base/introspection.py b/django/db/backends/base/introspection.py
index 762cca441f..7f3c7aca59 100644
--- a/django/db/backends/base/introspection.py
+++ b/django/db/backends/base/introspection.py
@@ -80,7 +80,10 @@ class BaseDatabaseIntrospection(object):
if not model._meta.managed:
continue
tables.add(model._meta.db_table)
- tables.update(f.m2m_db_table() for f in model._meta.local_many_to_many)
+ tables.update(
+ f.m2m_db_table() for f in model._meta.local_many_to_many
+ if f.remote_field.through._meta.managed
+ )
tables = list(tables)
if only_existing:
existing_tables = self.table_names(include_views=include_views)