forked from jazzband/django-fsm-log
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created and applied settings configurations
- Loading branch information
Justin Arulnathan
committed
Jan 22, 2014
1 parent
44d366b
commit 6bf3d6e
Showing
4 changed files
with
24 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django.core.exceptions import ImproperlyConfigured | ||
from django.core.cache import get_cache | ||
from django.conf import settings | ||
from .settings import DJANGO_FSM_LOG_USE_CACHE | ||
|
||
if DJANGO_FSM_LOG_USE_CACHE: | ||
if hasattr(settings, 'DJANGO_FSM_LOG_CACHE_BACKEND'): | ||
cache = get_cache(settings.DJANGO_FSM_LOG_CACHE_BACKEND) | ||
elif hasattr(settings, 'DJANGO_FSM_LOG_CACHE_BACKEND'): | ||
raise ImproperlyConfigured | ||
else: | ||
cache = get_cache('default') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
"""Settings for django-fsm-log""" | ||
import logging | ||
from django.conf import settings | ||
|
||
LOG = logging.getLogger(__name__) | ||
|
||
if not hasattr(settings, 'CACHES'): | ||
LOG.warning("No cache backend set in django. You will not be able to access pending StateLogs") | ||
DJANGO_FSM_LOG_PENDING_STATELOGS = False | ||
if hasattr(settings, 'DJANGO_FSM_LOG_USE_CACHE'): | ||
DJANGO_FSM_LOG_USE_CACHE = settings.DJANGO_FSM_LOG_USE_CACHE | ||
else: | ||
DJANGO_FSM_LOG_PENDING_STATELOGS = True | ||
DJANGO_FSM_LOG_USE_CACHE = False |