Skip to content

Commit e33a56e

Browse files
committed
Rename path -> proxito_path
1 parent 01eb349 commit e33a56e

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

readthedocs/proxito/views/serve.py

+8-14
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,7 @@ def _get_index_file_redirect(self, request, project, version, filename, full_pat
526526

527527
return None
528528

529-
def get_using_unresolver(self, request, path):
530-
"""
531-
404 handler using the new proxito implementation.
532-
533-
This is basically a copy of the get() method, but adapted to make use
534-
of the unresolver to extract the current project, version, and file.
535-
"""
529+
def get_using_unresolver(self, request, proxito_path):
536530
unresolved_domain = request.unresolved_domain
537531
# We force all storage calls to use the external versions storage,
538532
# since we are serving an external version.
@@ -546,7 +540,7 @@ def get_using_unresolver(self, request, path):
546540
version = None
547541
# If we weren't able to resolve a filename,
548542
# then the path is the filename.
549-
filename = path
543+
filename = proxito_path
550544
lang_slug = None
551545
version_slug = None
552546
# Try to map the current path to a project/version/filename.
@@ -558,7 +552,7 @@ def get_using_unresolver(self, request, path):
558552
try:
559553
unresolved = unresolver.unresolve_path(
560554
unresolved_domain=unresolved_domain,
561-
path=path,
555+
path=proxito_path,
562556
append_indexhtml=False,
563557
)
564558
project = unresolved.project
@@ -610,7 +604,7 @@ def get_using_unresolver(self, request, path):
610604
project=project,
611605
version=version,
612606
filename=filename,
613-
full_path=path,
607+
full_path=proxito_path,
614608
)
615609
if response:
616610
return response
@@ -624,12 +618,12 @@ def get_using_unresolver(self, request, path):
624618
lang_slug=lang_slug,
625619
version_slug=version_slug,
626620
filename=filename,
627-
full_path=path,
621+
full_path=proxito_path,
628622
)
629623
if redirect_path and http_status:
630624
try:
631625
return self.get_redirect_response(
632-
request, redirect_path, path, http_status
626+
request, redirect_path, proxito_path, http_status
633627
)
634628
except InfiniteRedirectException:
635629
# ``get_redirect_response`` raises this when it's redirecting back to itself.
@@ -642,7 +636,7 @@ def get_using_unresolver(self, request, path):
642636
project=project,
643637
version=version,
644638
path=filename,
645-
full_path=path,
639+
full_path=proxito_path,
646640
)
647641

648642
response = self._get_custom_404_page(
@@ -658,7 +652,7 @@ def get_using_unresolver(self, request, path):
658652
# or other error handling is developed (version, language, filename).
659653
raise contextualized_404_class(
660654
project=project,
661-
path_not_found=path,
655+
path_not_found=proxito_path,
662656
)
663657

664658

0 commit comments

Comments
 (0)