From b64d44fd01d504fbcbf3a180f9e620fed6d527ed Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 1 Oct 2019 14:22:55 +0200 Subject: [PATCH] Chunks safe. --- chunks/templatetags/chunks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.20.1