Skip to content

Commit

Permalink
Use Django get_cache to ensure Django 1.6 compatibility - see PolicyS…
Browse files Browse the repository at this point in the history
  • Loading branch information
rhunwicks committed Jul 13, 2016
1 parent f917f2f commit 5422229
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jobtastic/cache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ def get_cache(app):

# Try Django
try:
from django.core.cache import caches, InvalidCacheBackendError
from django.core.cache import (get_cache as get_django_cache,
InvalidCacheBackendError)
if jobtastic_cache_setting:
try:
return WrappedCache(caches[jobtastic_cache_setting])
return WrappedCache(get_django_cache(jobtastic_cache_setting))
except InvalidCacheBackendError:
pass
else:
return WrappedCache(caches['default'])
return WrappedCache(get_django_cache('default'))
except ImportError:
pass

Expand Down

0 comments on commit 5422229

Please sign in to comment.