1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

Fixed #16353 -- don't try to create Site objects on all databases. Refs #15573, #15346. Thanks Aymeric Augustin for the report and the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16868 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Carl Meyer
2011-09-21 22:46:48 +00:00
parent cfadc36be5
commit f91af72523
3 changed files with 9 additions and 18 deletions

View File

@@ -56,14 +56,6 @@ class SpatiaLiteCreation(DatabaseCreation):
interactive=False,
database=self.connection.alias)
# One effect of calling syncdb followed by flush is that the id of the
# default site may or may not be 1, depending on how the sequence was
# reset. If the sites app is loaded, then we coerce it.
from django.db.models import get_model
Site = get_model('sites', 'Site')
if Site is not None and Site.objects.using(self.connection.alias).count() == 1:
Site.objects.using(self.connection.alias).update(id=settings.SITE_ID)
from django.core.cache import get_cache
from django.core.cache.backends.db import BaseDatabaseCache
for cache_alias in settings.CACHES: