Skip to content

Commit

Permalink
Fix caching when using redis-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammy Maris committed Apr 9, 2015
1 parent 5a2b0f9 commit c450348
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions parler/cache.py
Expand Up @@ -14,9 +14,7 @@
long = int

try:
# In Django 1.6, a timeout of 0 seconds is accepted as valid input,
# and a sentinel value is used to denote the default timeout. Use that.
from django.core.cache.backends.base import DEFAULT_TIMEOUT
DEFAULT_TIMEOUT = cache.cache.default_timeout
except ImportError:
DEFAULT_TIMEOUT = 0

Expand Down

1 comment on commit c450348

@skirsdeda
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this broke caching :) Since the import is 'from django.core.cache import cache', cache.cache doesn't exist. Instead, it should be:

DEFAULT_TIMEOUT = cache.default_timeout

Please sign in to comment.