summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorAndrew Nester <andrew.nester.dev@gmail.com>2016-06-30 14:22:10 +0300
committerTim Graham <timograham@gmail.com>2016-06-30 08:53:38 -0400
commitbaff4dd37dabfef1ff939513fa45124382b57bf8 (patch)
tree1f3927a367fd02ba599c9a475a356b16ca47f328 /django/db
parent490107f14dbf9445e145aea1157b27e7ef407214 (diff)
Fixed #25292 -- Fixed crash in ManyToManyField.through_fields check.
Diffstat (limited to 'django/db')
-rw-r--r--django/db/models/base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 2444c22b01..80d98b1399 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -1687,6 +1687,10 @@ class Model(six.with_metaclass(ModelBase)):
)
for f in cls._meta.local_many_to_many:
+ # Skip nonexistent models.
+ if isinstance(f.remote_field.through, six.string_types):
+ continue
+
# Check if auto-generated name for the M2M field is too long
# for the database.
for m2m in f.remote_field.through._meta.local_fields: