Skip to content

Commit 52fcd53

Browse files
committed
Can't simplfiy logic that much, revert
1 parent 4b87393 commit 52fcd53

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

readthedocs/proxito/views/serve.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,15 @@ def get(self,
8989
# because it is taken from the host name
9090
version_slug is None or hasattr(request, 'external_domain'),
9191
filename == '',
92-
# Handle `/projects/subproject` and `/projects/subproject/` URL redirects
93-
not final_project.single_version or not subproject_slash,
92+
not final_project.single_version,
93+
]):
94+
return self.system_redirect(request, final_project, lang_slug, version_slug, filename)
95+
96+
# Handle `/projects/subproject` URL redirection
97+
if all([
98+
final_project.single_version,
99+
filename == '',
100+
not subproject_slash,
94101
]):
95102
return self.system_redirect(request, final_project, lang_slug, version_slug, filename)
96103

0 commit comments

Comments
 (0)