Browse Source

Fix weird autodetector error

Andrew Godwin 11 years ago
parent
commit
40afdaf08c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      django/db/models/fields/related.py

+ 1 - 1
django/db/models/fields/related.py

@@ -2035,7 +2035,7 @@ class ManyToManyField(RelatedField):
         if getattr(self.rel, 'through', None) is not None:
             if isinstance(self.rel.through, six.string_types):
                 kwargs['through'] = self.rel.through
-            else:
+            elif not self.rel.through._meta.auto_created:
                 kwargs['through'] = "%s.%s" % (self.rel.through._meta.app_label, self.rel.through._meta.object_name)
         # If swappable is True, then see if we're actually pointing to the target
         # of a swap.