Applied TextNode fix to sekizai postprocessor, fixes the double render issue. fixes #361
This commit is contained in:

committed by
Johannes Linke

parent
8429c93535
commit
9d9b20a14a
@@ -6,7 +6,7 @@
|
|||||||
and: https://github.com/ojii/django-sekizai.git@0.6 or later
|
and: https://github.com/ojii/django-sekizai.git@0.6 or later
|
||||||
"""
|
"""
|
||||||
from compressor.templatetags.compress import CompressorNode
|
from compressor.templatetags.compress import CompressorNode
|
||||||
from django.template.base import Template
|
from django.template.base import TextNode
|
||||||
|
|
||||||
|
|
||||||
def compress(context, data, name):
|
def compress(context, data, name):
|
||||||
@@ -15,4 +15,4 @@ def compress(context, data, name):
|
|||||||
Name is either 'js' or 'css' (the sekizai namespace)
|
Name is either 'js' or 'css' (the sekizai namespace)
|
||||||
Basically passes the string through the {% compress 'js' %} template tag
|
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)
|
||||||
|
@@ -22,6 +22,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'compressor',
|
'compressor',
|
||||||
'coffin',
|
'coffin',
|
||||||
|
'sekizai',
|
||||||
]
|
]
|
||||||
if django.VERSION < (1, 8):
|
if django.VERSION < (1, 8):
|
||||||
INSTALLED_APPS.append('jingo')
|
INSTALLED_APPS.append('jingo')
|
||||||
|
Reference in New Issue
Block a user