Skip to content

Commit

Permalink
fix: more n+1 queries
Browse files Browse the repository at this point in the history
  • Loading branch information
alubbock committed Mar 12, 2024
1 parent e2cd569 commit 67f5d81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/antigenapi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Meta: # noqa: D106
class ProjectViewSet(AuditLogMixin, DeleteProtectionMixin, ModelViewSet):
"""A view set displaying all recorded projects."""

queryset = Project.objects.all()
queryset = Project.objects.all().select_related("added_by")
serializer_class = ProjectSerializer

def perform_create(self, serializer):
Expand All @@ -147,7 +147,7 @@ class Meta: # noqa: D106
class LlamaViewSet(AuditLogMixin, DeleteProtectionMixin, ModelViewSet):
"""A view set for llamas."""

queryset = Llama.objects.all()
queryset = Llama.objects.all().select_related("added_by")
serializer_class = LlamaSerializer

def perform_create(self, serializer): # noqa: D102
Expand Down

0 comments on commit 67f5d81

Please sign in to comment.