Fixes Django 1.8 compatibility.
This commit is contained in:
parent
ce9ec0c0a1
commit
f82c48f391
|
@ -1,3 +1,4 @@
|
|||
from django import VERSION as django_version
|
||||
from django.apps import AppConfig
|
||||
from django.conf import settings
|
||||
from django.core.checks import register, Tags, Warning, Error
|
||||
|
@ -9,7 +10,11 @@ from .settings import (
|
|||
SUPPORTED_ONLY)
|
||||
|
||||
|
||||
@register(Tags.caches, Tags.compatibility)
|
||||
DJANGO_GTE_1_10 = django_version[:2] >= (1, 10)
|
||||
|
||||
|
||||
@register(*((Tags.caches, Tags.compatibility)
|
||||
if DJANGO_GTE_1_10 else (Tags.compatibility,)))
|
||||
def check_cache_compatibility(app_configs, **kwargs):
|
||||
cache = settings.CACHES[cachalot_settings.CACHALOT_CACHE]
|
||||
cache_backend = cache['BACKEND']
|
||||
|
@ -23,7 +28,8 @@ def check_cache_compatibility(app_configs, **kwargs):
|
|||
return []
|
||||
|
||||
|
||||
@register(Tags.database, Tags.compatibility)
|
||||
@register(*((Tags.database, Tags.compatibility)
|
||||
if DJANGO_GTE_1_10 else (Tags.compatibility,)))
|
||||
def check_databases_compatibility(app_configs, **kwargs):
|
||||
errors = []
|
||||
databases = settings.DATABASES
|
||||
|
|
Loading…
Reference in New Issue