Permalink
Browse files

Taking a shortcut if there is nothing to do.

  • Loading branch information...
1 parent f4a7299 commit 40a9fc34c2b4635fde7b66d807ff4ee58b81c4b8 @jezdez jezdez committed Feb 1, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 compressor/templatetags/compress.py
View
6 compressor/templatetags/compress.py
@@ -89,6 +89,12 @@ def render_compressed(self, context, kind, mode, forced=False):
if cached_offline:
return cached_offline
+ # Take a shortcut if we really don't have anything to do
+ if ((not settings.COMPRESS_ENABLED and
+ not settings.COMPRESS_PRECOMPILERS)
+ and not forced):
+ return self.get_original_content(context)
+
context['compressed'] = {'name': getattr(self, 'name', None)}
compressor = self.get_compressor(context, kind)

0 comments on commit 40a9fc3

Please sign in to comment.