Skip to content

Commit 71d5ec1

Browse files
committed
Use getattr for checking subdomain and cname on request
1 parent ca14616 commit 71d5ec1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

readthedocs/core/views/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def server_error_404(request, exception=None, template_name='404.html'): # pyli
133133
return response
134134

135135
# Try to serve custom 404 pages if it's a subdomain/cname
136-
if request.subdomain or request.cname:
136+
if getattr(request, 'subdomain', False) or getattr(request, 'cname', False):
137137
return server_error_404_subdomain(request, template_name)
138138

139139
# Return the default 404 page generated by Read the Docs

readthedocs/doc_builder/python_environments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def install_core_requirements(self):
443443
cmd.extend(requirements)
444444
self.build_env.run(
445445
*cmd,
446-
cwd=self.checkout_path # noqa - no comma here in py27 :/
446+
cwd=self.checkout_path,
447447
)
448448

449449
pip_cmd = [

0 commit comments

Comments
 (0)