From 7345705b08179ad6a3a02a6135af314b756ea48f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 21 Aug 2021 20:21:39 -0700 Subject: [PATCH] Small efficiency improvement in list view --- bookwyrm/views/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/views/list.py b/bookwyrm/views/list.py index 6e872434..36175937 100644 --- a/bookwyrm/views/list.py +++ b/bookwyrm/views/list.py @@ -116,7 +116,7 @@ class List(View): if direction == "descending": directional_sort_by = "-" + directional_sort_by - items = book_list.listitem_set + items = book_list.listitem_set.prefetch_related("user", "book", "book__authors") if sort_by == "rating": items = items.annotate( average_rating=Avg(