From b16a2ad0cc77c1b5cd3fd86e282d4b167089c12e Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 19 May 2024 20:56:05 +0100 Subject: [PATCH] Use select_related to JOIN for UserModSettings --- pydis_site/apps/api/viewsets/bot/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydis_site/apps/api/viewsets/bot/user.py b/pydis_site/apps/api/viewsets/bot/user.py index c0b4ca0f42..ce712a939f 100644 --- a/pydis_site/apps/api/viewsets/bot/user.py +++ b/pydis_site/apps/api/viewsets/bot/user.py @@ -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')