diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 67ecefb..50b98f1 100644
a
|
b
|
class ManyToManyField(RelatedField):
|
1438 | 1438 | return errors |
1439 | 1439 | |
1440 | 1440 | def _check_table_uniqueness(self, **kwargs): |
1441 | | if isinstance(self.remote_field.through, six.string_types): |
| 1441 | if isinstance(self.remote_field.through, six.string_types) or not self.remote_field.through._meta.managed: |
1442 | 1442 | return [] |
1443 | 1443 | registered_tables = { |
1444 | 1444 | model._meta.db_table: model |
1445 | 1445 | for model in self.opts.apps.get_models(include_auto_created=True) |
1446 | | if model != self.remote_field.through |
| 1446 | if model != self.remote_field.through and model._meta.managed |
1447 | 1447 | } |
1448 | 1448 | m2m_db_table = self.m2m_db_table() |
1449 | 1449 | if m2m_db_table in registered_tables: |