Skip to content

Commit

Permalink
Use get_template from Django to load templates so that templates are
Browse files Browse the repository at this point in the history
loaded with the appropriate template loader.
  • Loading branch information
mlp-ableton committed Jun 21, 2012
1 parent 473a5fd commit eef07d8
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions compressor/management/commands/compress.py
Expand Up @@ -214,16 +214,7 @@ def compress(self, log=None, **options):
compressor_nodes = SortedDict()
for template_name in templates:
try:
template_file = open(template_name)
try:
template = Template(template_file.read().decode(
settings.FILE_CHARSET))
finally:
template_file.close()
except IOError: # unreadable file -> ignore
if verbosity > 0:
log.write("Unreadable template at: %s\n" % template_name)
continue
template = get_template(template_name)
except TemplateSyntaxError, e: # broken template -> ignore
if verbosity > 0:
log.write("Invalid template %s: %s\n" % (template_name, e))
Expand Down

0 comments on commit eef07d8

Please sign in to comment.