Turned around the order in which the files are looked for, now it first tries to find it with the storage backend, then with staticfiles' finder. That way we solve this for development and production. Fixes #85.

This commit is contained in:
Jannis Leidel
2011-08-10 17:43:27 +02:00
parent d616f14449
commit 02809e396b

View File

@@ -64,11 +64,11 @@ class Compressor(object):
def get_filename(self, basename):
# first try to find it with staticfiles (in debug mode)
filename = None
if self.finders:
filename = self.finders.find(basename)
# secondly try finding the file in the root
elif self.storage.exists(basename):
if self.storage.exists(basename):
filename = self.storage.path(basename)
# secondly try finding the file in the root
elif self.finders:
filename = self.finders.find(basename)
if filename:
return filename
# or just raise an exception as the last resort