Skip to content

Commit

Permalink
Fixed issue in static.py
Browse files Browse the repository at this point in the history
  • Loading branch information
elisakiv committed Feb 6, 2024
1 parent 066cce6 commit 80366e1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/web/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ def get_full_static_url(url: str):
return f"{settings.STATIC_URL}{url}"

def file_hash(self, name, content=None):
normalized_file_path = Path(name).as_posix()
# Don't hash the filename if the path matches any of the patterns in the `MANIFEST_STATICFILES_IGNORE_PATTERNS` setting
if any(
fnmatchcase(normalized_file_path, pattern)
for pattern in settings.MANIFEST_STATICFILES_IGNORE_PATTERNS
):
return None
if name:
normalized_file_path = Path(name).as_posix()

Check warning on line 70 in src/web/static.py

View check run for this annotation

Codecov / codecov/patch

src/web/static.py#L69-L70

Added lines #L69 - L70 were not covered by tests
# Don't hash the filename if the path matches any of the patterns in the `MANIFEST_STATICFILES_IGNORE_PATTERNS` setting
if any(

Check warning on line 72 in src/web/static.py

View check run for this annotation

Codecov / codecov/patch

src/web/static.py#L72

Added line #L72 was not covered by tests
fnmatchcase(normalized_file_path, pattern)
for pattern in settings.MANIFEST_STATICFILES_IGNORE_PATTERNS
):
return None

Check warning on line 76 in src/web/static.py

View check run for this annotation

Codecov / codecov/patch

src/web/static.py#L76

Added line #L76 was not covered by tests

return super().file_hash(name, content)

Expand Down

0 comments on commit 80366e1

Please sign in to comment.