Ticket #17467: django_db_create_test_db.diff

File django_db_create_test_db.diff, 726 bytes (added by kallous@…, 13 years ago)
  • creation.py

    old new  
    382382        if 'django.contrib.sites' in settings.INSTALLED_APPS:
    383383            Site = get_model('sites', 'Site')
    384384            if Site is not None and Site.objects.using(self.connection.alias).count() == 1:
    385                 Site.objects.using(self.connection.alias).update(id=settings.SITE_ID)
     385                if Site.objects.using(self.connection.alias).all()[0].id != settings.SITE_ID:
     386                    Site.objects.using(self.connection.alias).update(id=settings.SITE_ID)
    386387
    387388        from django.core.cache import get_cache
    388389        from django.core.cache.backends.db import BaseDatabaseCache
Back to Top