Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refs #15093 -- Fixed another get_models call missed in r16053. Thanks…

… Luke for catching it.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16108 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2706fdbc87037976c3165beb5b9b73e000ff479b 1 parent 04654e5
@carljm carljm authored
View
2  django/db/models/options.py
@@ -420,7 +420,7 @@ def _fill_related_many_to_many_cache(self):
cache[obj] = parent
else:
cache[obj] = model
- for klass in get_models():
+ for klass in get_models(only_installed=False):
for f in klass._meta.local_many_to_many:
if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:
cache[RelatedObject(f.rel.to, klass, f)] = None
View
4 tests/regressiontests/app_loading/not_installed/models.py
@@ -7,3 +7,7 @@ class NotInstalledModel(models.Model):
class RelatedModel(models.Model):
not_installed = models.ForeignKey(NotInstalledModel)
+
+
+class M2MRelatedModel(models.Model):
+ not_installed = models.ManyToManyField(NotInstalledModel)
View
2  tests/regressiontests/app_loading/tests.py
@@ -122,4 +122,4 @@ def test_related_not_installed_model(self):
from .not_installed.models import NotInstalledModel
self.assertEqual(
set(NotInstalledModel._meta.get_all_field_names()),
- set(["id", "relatedmodel"]))
+ set(["id", "relatedmodel", "m2mrelatedmodel"]))
Please sign in to comment.
Something went wrong with that request. Please try again.