Skip to content

Commit

Permalink
fix: exclude projects with no releases (pypi#17270)
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman authored Dec 11, 2024
1 parent 8488a4b commit 9a38f0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/unit/accounts/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ def test_user_profile_queries_once_for_all_projects(
created=project.created + datetime.timedelta(minutes=3),
is_prerelease=True,
)
# add one more project, associated to the user, but no releases
RoleFactory.create(user=user, project=ProjectFactory.create())

with query_recorder:
response = views.profile(user, db_request)
Expand Down
2 changes: 1 addition & 1 deletion warehouse/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def profile(user, request):
Release.summary,
)
.join(Role, Project.id == Role.project_id)
.outerjoin(
.join(
latest_releases_subquery,
Project.id == latest_releases_subquery.c.project_id,
)
Expand Down

0 comments on commit 9a38f0a

Please sign in to comment.