Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 13, 2022
1 parent 6c391ef commit 5a313a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/whitenoise/base.py
Expand Up @@ -153,18 +153,21 @@ def find_file(self, url):
if settings.DEBUG and url.startswith(settings.STATIC_URL):
paths = "\n ".join(self.candidate_paths_for_url(url))
from django.contrib.staticfiles.finders import get_finders

finders = get_finders()
app_dirs = []
for finder in finders:
for storage in finder.storages.values():
app_dirs.append(storage.location)
app_dirs = "\n ".join(sorted(app_dirs))
raise MissingFileError(f"""{url} not found. Searched these paths:
raise MissingFileError(
f"""{url} not found. Searched these paths:
{paths}
App dirs:
{app_dirs}""")
{app_dirs}"""
)

def candidate_paths_for_url(self, url):
for root, prefix in self.directories:
Expand Down

0 comments on commit 5a313a6

Please sign in to comment.