Deal with backwards compatibility by exception.

This commit is contained in:
Gary Reynolds 2017-06-02 17:56:37 +10:00
parent 2abbbdab43
commit df359d2bfc
2 changed files with 3 additions and 7 deletions

View File

@ -5,7 +5,6 @@ multi-tenant setting
import hashlib
from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import connection
@ -17,15 +16,13 @@ from django.utils.encoding import force_bytes
from tenant_schemas.postgresql_backend.base import FakeTenant
DJANGO_1_9 = DJANGO_VERSION[0] == 1 and DJANGO_VERSION[1] >= 9
if DJANGO_1_9:
try:
from django.template import Origin
def make_origin(engine, name, loader, template_name, dirs):
return Origin(name=name, template_name=template_name, loader=loader)
else:
except ImportError: # Django 1.8 backwards compatibility
def make_origin(engine, name, loader, template_name, dirs):
return engine.make_origin(name, loader, template_name, dirs)

View File

@ -2,7 +2,6 @@ from django.conf import settings
from django.core.management import call_command
from django.db import connection
from django.test import TestCase
from tenant_schemas.utils import get_public_schema_name, get_tenant_model
ALLOWED_TEST_DOMAIN = '.test.com'