Skip to content
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

Hosting: Don't check for superprojects on subprojects #11683

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions readthedocs/proxito/tests/test_hosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,22 @@ def test_number_of_queries_url_subproject(self):
)
assert r.status_code == 200

# Test parent project has fewer queries
with self.assertNumQueries(26):
r = self.client.get(
reverse("proxito_readthedocs_docs_addons"),
{
"url": "https://project.dev.readthedocs.io/en/latest/",
"client-version": "0.6.0",
"api-version": "1.0.0",
},
secure=True,
headers={
"host": "project.dev.readthedocs.io",
},
)
assert r.status_code == 200

def test_number_of_queries_url_translations(self):
# Create multiple translations to be shown in the flyout
for language in ["ja", "es", "ru", "pt-br"]:
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/proxito/views/hosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def _v1(self, project, version, build, filename, url, request):
f"subprojects:{project.slug}/{version.slug}",
]
)
if project.superprojects.exists():
elif project.superprojects.exists():
superproject = project.superprojects.first().parent
data["addons"]["search"]["filters"].append(
[
Expand Down