Applied TextNode fix to sekizai postprocessor, fixes the double render issue. fixes #361

This commit is contained in:
Aaron Croyle
2013-02-05 14:57:47 -05:00
committed by Johannes Linke
parent 8429c93535
commit 9d9b20a14a
2 changed files with 3 additions and 2 deletions

View File

@@ -6,7 +6,7 @@
and: https://github.com/ojii/django-sekizai.git@0.6 or later
"""
from compressor.templatetags.compress import CompressorNode
from django.template.base import Template
from django.template.base import TextNode
def compress(context, data, name):
@@ -15,4 +15,4 @@ def compress(context, data, name):
Name is either 'js' or 'css' (the sekizai namespace)
Basically passes the string through the {% compress 'js' %} template tag
"""
return CompressorNode(nodelist=Template(data).nodelist, kind=name, mode='file').render(context=context)
return CompressorNode(nodelist=TextNode(data), kind=name, mode='file').render(context=context)

View File

@@ -22,6 +22,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'compressor',
'coffin',
'sekizai',
]
if django.VERSION < (1, 8):
INSTALLED_APPS.append('jingo')