Skip to content

Commit

Permalink
Use select_related to JOIN for UserModSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed May 24, 2024
1 parent 086e941 commit b16a2ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydis_site/apps/api/viewsets/bot/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class UserViewSet(ModelViewSet):
"""

serializer_class = UserSerializer
queryset = User.objects.all().order_by("id")
queryset = User.objects.select_related("mod_settings").all().order_by("id")
pagination_class = UserListPagination
filter_backends = (DjangoFilterBackend,)
filterset_fields = ('name', 'discriminator', 'display_name')
Expand Down

0 comments on commit b16a2ad

Please sign in to comment.