Skip to content

Commit

Permalink
BACKWARDS-INCOMPATIBLE: Stopped swallowing the exceptions raised by t…
Browse files Browse the repository at this point in the history
…he template tag.

Refs django-compressor#37.
  • Loading branch information
jezdez committed Aug 9, 2011
1 parent d588a19 commit ddc6710
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 3 additions & 11 deletions compressor/templatetags/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,9 @@ def render(self, context, forced=False):

# 4. call compressor output method and handle exceptions
rendered_output = compressor.output(self.mode, forced=forced)
try:
rendered_output = compressor.output(self.mode, forced=forced)
if cache_key:
cache_set(cache_key, rendered_output)
return rendered_output
except Exception, e:
if settings.DEBUG or forced:
raise e

# 5. Or don't do anything in production
return self.nodelist.render(context)
if cache_key:
cache_set(cache_key, rendered_output)
return rendered_output


@register.tag
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Changelog
HEAD
----

- **BACKWARDS-INCOMPATIBLE** Stopped swallowing exceptions raised by
rendering the template tag in production (``DEBUG = False``). This
has the potential to breaking lots of apps but on the other hand
will help find bugs.

- Added Compass filter (beta).

- Fixed compiler filters on Windows.
Expand All @@ -17,6 +22,7 @@ HEAD
- Added new CallbackOutputFilter to ease the implementation of Python-based
callback filters that only need to pass the content to a callable.


.. _`Slim It`: http://slimit.org/

0.9.2
Expand Down

0 comments on commit ddc6710

Please sign in to comment.