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:
@@ -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
|
||||
|
Reference in New Issue
Block a user