Skip to content

Commit

Permalink
Preload nomination entries in nomination viewset
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristgit committed Dec 15, 2023
1 parent 14e9005 commit f04fbeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydis_site/apps/api/viewsets/bot/nomination.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge
"""

serializer_class = NominationSerializer
queryset = Nomination.objects.all()
queryset = Nomination.objects.all().prefetch_related('entries')
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_fields = ('user__id', 'active')
frozen_on_create = ('ended_at', 'end_reason', 'active', 'inserted_at', 'reviewed')
Expand Down

0 comments on commit f04fbeb

Please sign in to comment.