Browse Source

404 on page not found (instead of TemplateDoesNotExist)

master
alice 4 weeks ago
parent
commit
7a23e29d8b
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      ccvpn/views.py

+ 7
- 4
ccvpn/views.py View File

@@ -88,10 +88,13 @@ def page(request, name):
except TemplateDoesNotExist:
pass

md_template = select_template([
basename + '.' + get_language() + '.md',
basename + '.en.md',
])
try:
md_template = select_template([
basename + '.' + get_language() + '.md',
basename + '.en.md',
])
except TemplateDoesNotExist:
return HttpResponseNotFound("Page not found")

page_source = md_template.render(None, request)
page_fm = frontmatter.loads(page_source)


Loading…
Cancel
Save