Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom template path calculation #3948

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cms/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def view_page(request, page_name):
f'but CMS page {page.pk} expects to find one.'
)
raise Http404
elif not os.path.exists(os.path.join(templates_path, page.template)):
elif not os.path.exists(
os.path.join(templates_path, os.path.basename(page.template))
):
logger.error(
f'CMS page {page.pk} is set to use '
f'nonexistent template {page.template}.'
Expand Down