From 12f773347588a6422c22c5a27f3509ffe9062203 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 14 Apr 2011 13:54:17 +0200 Subject: [PATCH] Only use os.path.exists on the path COMPRESS_ROOT path, not on the one from staticfiles. --- compressor/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compressor/base.py b/compressor/base.py index 11d6a81..11465f6 100644 --- a/compressor/base.py +++ b/compressor/base.py @@ -57,8 +57,10 @@ class Compressor(object): filename = self.finders.find(basename) # secondly try finding the file in the root else: - filename = os.path.join(settings.COMPRESS_ROOT, basename) - if filename and os.path.exists(filename): + root_filename = os.path.join(settings.COMPRESS_ROOT, basename) + if os.path.exists(root_filename): + filename = root_filename + if filename: return filename # or just raise an exception as the last resort raise UncompressableFileError(