Only use os.path.exists on the path COMPRESS_ROOT path, not on the one from staticfiles.

This commit is contained in:
Jannis Leidel
2011-04-14 13:54:17 +02:00
parent b40a8f1402
commit 12f7733475

View File

@@ -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(