Skip to content

Commit

Permalink
Fixes N+1 queries in Daily Rounds (#1700)
Browse files Browse the repository at this point in the history
Fixes #1699: N+1 queries in Daily Rounds
  • Loading branch information
rithviknishad authored Nov 8, 2023
1 parent 942cfe5 commit 6f4bedb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion care/facility/api/viewsets/daily_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ class DailyRoundsViewSet(
IsAuthenticated,
DRYPermissions,
)
queryset = DailyRound.objects.all().order_by("-id")
queryset = (
DailyRound.objects.all()
.order_by("-id")
.select_related("created_by", "last_edited_by")
)
lookup_field = "external_id"
filterset_class = DailyRoundFilterSet

Expand Down

0 comments on commit 6f4bedb

Please sign in to comment.