Commit e5d0ab0a by andreas.pelme

Fixed #15. Thanks Alexander Pugachev!


git-svn-id: https://django-compress.googlecode.com/svn/trunk@70 98d35234-f74b-0410-9e22-51d878bdf110
parent a0b88187
...@@ -11,7 +11,7 @@ register = template.Library() ...@@ -11,7 +11,7 @@ register = template.Library()
def render_common(template_name, obj, filename, version): def render_common(template_name, obj, filename, version):
if settings.COMPRESS: if settings.COMPRESS:
filename = get_output_filename(filename, get_version(version)) filename = get_output_filename(filename, version)
context = obj.get('extra_context', {}) context = obj.get('extra_context', {})
context['url'] = media_url(filename) context['url'] = media_url(filename)
......
...@@ -86,8 +86,8 @@ def save_file(filename, contents): ...@@ -86,8 +86,8 @@ def save_file(filename, contents):
fd.close() fd.close()
def get_output_filename(filename, version): def get_output_filename(filename, version):
if settings.COMPRESS_VERSION: if settings.COMPRESS_VERSION and version is not None:
return filename.replace(settings.COMPRESS_VERSION_PLACEHOLDER, version) return filename.replace(settings.COMPRESS_VERSION_PLACEHOLDER, get_version(version))
else: else:
return filename.replace(settings.COMPRESS_VERSION_PLACEHOLDER, settings.COMPRESS_VERSION_DEFAULT) return filename.replace(settings.COMPRESS_VERSION_PLACEHOLDER, settings.COMPRESS_VERSION_DEFAULT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment