1. Luke Plant
  2. django

Commits

Al...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed e8d474c

[soc2009/multidb] Fixed a problem with overzealous purging of contenttypes during syncdb. Patch from Russell Keith-Magee.

  • Participants
  • Parent commits 6daf751
  • Branches soc2009/multidb

Comments (0)

Files changed (1)

File django/contrib/contenttypes/management.py

View file
     Creates content types for models in the given app, removing any model
     entries that no longer have a matching model class.
     """
+    db = kwargs['db']
     ContentType.objects.clear_cache()
-    content_types = list(ContentType.objects.filter(app_label=app.__name__.split('.')[-2]))
+    content_types = list(ContentType.objects.using(db).filter(app_label=app.__name__.split('.')[-2]))
     app_models = get_models(app)
-    db = kwargs['db']
     if not app_models:
         return
     for klass in app_models: