Skip to content

Commit

Permalink
Merge pull request #1601 from laws-africa/citation-n+1
Browse files Browse the repository at this point in the history
Fix n+1 for document citations
  • Loading branch information
actlikewill authored Nov 1, 2023
2 parents d4853f0 + f969fd2 commit 86cb721
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions peachjam/views/generic_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def fetch_docs(self, works):
docs = sorted(
list(
CoreDocument.objects.prefetch_related("work")
.select_related("nature")
.filter(work__in=works)
.distinct("work_frbr_uri")
.order_by("work_frbr_uri", "-date")
Expand Down

0 comments on commit 86cb721

Please sign in to comment.