Skip to content

Addons: get final project (e.g. subproject) #10745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions readthedocs/proxito/views/hosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,15 @@ def _resolve_resources(self):
return None, None, None, None

unresolved_domain = self.request.unresolved_domain

# Main project from the domain.
project = unresolved_domain.project

try:
unresolved_url = unresolver.unresolve_url(url)
# Project from the URL: if it's a subproject it will differ from
# the main project got from the domain.
project = unresolved_url.project
version = unresolved_url.version
filename = unresolved_url.filename
build = version.builds.last()
Expand Down Expand Up @@ -247,6 +252,8 @@ def _v0(self, project, version, build, filename, user):
" AND IT'S GOING TO CHANGE COMPLETELY -- DO NOT USE IT!"
),
"projects": {
# TODO: return the "parent" project here when the "current"
# project is a subproject/translation.
"current": ProjectSerializerNoLinks(project).data,
},
"versions": {
Expand Down