Skip to content

Commit

Permalink
add some missing DB prefetches (#758)
Browse files Browse the repository at this point in the history
[#188745162]
  • Loading branch information
uraniumanchor authored Jan 6, 2025
1 parent 1b023a2 commit 36a44b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tracker/api/views/interview.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class InterviewViewSet(TrackerFullViewSet, EventCreateNestedMixin):
queryset = Interview.objects.select_related('event')
queryset = Interview.objects.select_related('event').prefetch_related('tags')
serializer_class = InterviewSerializer
pagination_class = TrackerPagination
permission_classes = [*PrivateGenericPermissions('interview', lambda o: o.public)]
Expand Down
6 changes: 4 additions & 2 deletions tracker/api/views/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ class SpeedRunViewSet(
EventNestedMixin,
TrackerFullViewSet,
):
queryset = SpeedRun.objects.select_related('event').prefetch_related(
'runners', 'hosts', 'commentators', 'video_links__link_type'
queryset = SpeedRun.objects.select_related(
'event', 'priority_tag'
).prefetch_related(
'runners', 'hosts', 'commentators', 'video_links__link_type', 'tags'
)
serializer_class = SpeedRunSerializer
pagination_class = TrackerPagination
Expand Down

0 comments on commit 36a44b2

Please sign in to comment.