Ticket #27204: 27204.diff

File 27204.diff, 920 bytes (added by Tim Graham, 8 years ago)

patch without tests

  • django/db/models/fields/related.py

    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):  
    14381438        return errors
    14391439
    14401440    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:
    14421442            return []
    14431443        registered_tables = {
    14441444            model._meta.db_table: model
    14451445            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
    14471447        }
    14481448        m2m_db_table = self.m2m_db_table()
    14491449        if m2m_db_table in registered_tables:
Back to Top