Skip to content

Commit

Permalink
perf: prefetch translations in LabelViewSet
Browse files Browse the repository at this point in the history
refs: KER-250
  • Loading branch information
voneiden committed Oct 28, 2024
1 parent 724e915 commit 57b858a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion democracy/views/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Meta:

class LabelViewSet(AuditLogApiView, viewsets.ReadOnlyModelViewSet, mixins.CreateModelMixin):
serializer_class = LabelSerializer
queryset = Label.objects.all()
queryset = Label.objects.all().prefetch_related("translations")
pagination_class = DefaultLimitPagination
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
filter_backends = (django_filters.rest_framework.DjangoFilterBackend,)
Expand Down

0 comments on commit 57b858a

Please sign in to comment.