django-tenant-schemas must only be the last app on INSTALLED_APPS on Django <1.7

This commit is contained in:
Bernardo Pires 2015-01-05 15:19:13 +01:00
parent c16a2d7d79
commit 0dd239e446
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import django
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
@ -22,7 +23,7 @@ if not settings.TENANT_APPS:
if not hasattr(settings, 'TENANT_MODEL'):
raise ImproperlyConfigured('TENANT_MODEL setting not set')
if settings.INSTALLED_APPS[-1] != 'tenant_schemas':
if django.VERSION < (1, 7, 0) and settings.INSTALLED_APPS[-1] != 'tenant_schemas':
warnings.warn(recommended_config, SyntaxWarning)
if 'tenant_schemas.routers.TenantSyncRouter' not in settings.DATABASE_ROUTERS: