From: Radek Czajka Date: Tue, 1 Oct 2019 12:22:55 +0000 (+0200) Subject: Chunks safe. X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/b64d44fd01d504fbcbf3a180f9e620fed6d527ed?ds=sidebyside Chunks safe. --- diff --git a/chunks/templatetags/chunks.py b/chunks/templatetags/chunks.py index 6231e4f..65399cb 100644 --- a/chunks/templatetags/chunks.py +++ b/chunks/templatetags/chunks.py @@ -1,6 +1,7 @@ from django import template from django.db import models from django.core.cache import cache +from django.utils.safestring import mark_safe from ..models import Chunk, Attachment @@ -20,7 +21,7 @@ def chunk(key, cache_time=0, raw=False): n = Chunk(key=key) n.save() return '' - return content.raw if raw else content + return mark_safe(unicode(content.raw if raw else content)) @register.simple_tag