Skip to content

Commit 80b0b0b

Browse files
committed
tweak implementation for #156
1 parent 507ccb4 commit 80b0b0b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

render_static/engine.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -720,19 +720,15 @@ def resolve_renderings(
720720
raise TemplateDoesNotExist(selector, chain=chain)
721721

722722
for _, template in templates.items():
723+
tmpl_abs_path = Path(template.origin.name).absolute()
723724
if any(
724725
(
725-
Path(template.origin.name).absolute().is_relative_to(excl)
726+
excl == tmpl_abs_path or excl in tmpl_abs_path.parents
726727
for excl in excluded_dirs
727728
)
728729
):
729730
continue
730-
if any(
731-
(
732-
Path(template.origin.name).absolute() == excl
733-
for excl in excluded_files
734-
)
735-
):
731+
if any((tmpl_abs_path == excl for excl in excluded_files)):
736732
continue
737733
yield Render(
738734
selector=selector,

0 commit comments

Comments
 (0)