Skip to content

Commit

Permalink
Merge pull request #6805 from readthedocs/respect-order-404
Browse files Browse the repository at this point in the history
Respect order when serving 404 (version -> default_version)
  • Loading branch information
stsewd authored Mar 23, 2020
2 parents 24ca737 + d948d5b commit 8f9cb19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion readthedocs/proxito/views/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ def get(self, request, proxito_path, template_name='404.html'):
# If that doesn't work, attempt to serve the 404 of the current version (version_slug)
# Secondly, try to serve the 404 page for the default version
# (project.get_default_version())
for version_slug_404 in set([version_slug, final_project.get_default_version()]):
versions = [version_slug]
default_version_slug = final_project.get_default_version()
if default_version_slug != version_slug:
versions.append(default_version_slug)
for version_slug_404 in versions:
for tryfile in ('404.html', '404/index.html'):
storage_root_path = final_project.get_storage_path(
type_='html',
Expand Down

0 comments on commit 8f9cb19

Please sign in to comment.