Skip to content

Commit

Permalink
[#315] fix: N+1 queryset bug for pull_requests/ page
Browse files Browse the repository at this point in the history
Update queryset in contributors.views.pull_requests
  • Loading branch information
DmGorokhov committed Oct 7, 2023
1 parent 518cf43 commit 75d81df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contributors/views/pull_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ class ListView(TableSortSearchAndPaginationMixin, generic.ListView):
ordering = sortable_fields[0]

template_name = 'pull_requests_list.html'
queryset = Contribution.objects.filter(type='pr')
queryset = (
Contribution.objects.filter(type='pr').
select_related('repository', 'contributor', 'info')
)

0 comments on commit 75d81df

Please sign in to comment.