X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/72272dce664793c3f2910b99837fcd35efa8e815..f3e8dfa015744bd72796fdd8eff0d81f863cdc46:/src/chunks/templatetags/chunks.py?ds=sidebyside diff --git a/src/chunks/templatetags/chunks.py b/src/chunks/templatetags/chunks.py index 1d7362607..200002b8e 100644 --- a/src/chunks/templatetags/chunks.py +++ b/src/chunks/templatetags/chunks.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- from django import template from django.core.cache import cache from django.utils.safestring import mark_safe +from django.utils.translation import get_language from ..models import Chunk, Attachment @@ -11,7 +11,7 @@ register = template.Library() @register.simple_tag def chunk(key, cache_time=0): try: - cache_key = 'chunk_' + key + cache_key = 'chunk:%s:%s' % (key, get_language()) c = cache.get(cache_key) if c is None: c = Chunk.objects.get(key=key)