Skip to content

Commit d948d5b

Browse files
committed
Respect order when serving 404 (version -> default_version)
This is also why tests are failing randomly, a set doesn't keep the order.
1 parent 24ca737 commit d948d5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

readthedocs/proxito/views/serve.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ def get(self, request, proxito_path, template_name='404.html'):
261261
# If that doesn't work, attempt to serve the 404 of the current version (version_slug)
262262
# Secondly, try to serve the 404 page for the default version
263263
# (project.get_default_version())
264-
for version_slug_404 in set([version_slug, final_project.get_default_version()]):
264+
versions = [version_slug]
265+
default_version_slug = final_project.get_default_version()
266+
if default_version_slug != version_slug:
267+
versions.append(default_version_slug)
268+
for version_slug_404 in versions:
265269
for tryfile in ('404.html', '404/index.html'):
266270
storage_root_path = final_project.get_storage_path(
267271
type_='html',

0 commit comments

Comments
 (0)