Slice queryset before we resolve it
This was accidentally querying ALL books in the database to generate suggestions if we didn't have enough, which broke some stuff
This commit is contained in:
parent
fdc53d6c60
commit
55bab0b70d
1 changed files with 2 additions and 2 deletions
|
@ -110,8 +110,8 @@ def get_list_suggestions(book_list, user, query=None):
|
|||
s.default_edition
|
||||
for s in models.Work.objects.filter(
|
||||
~Q(editions__in=book_list.books.all()),
|
||||
).order_by("-updated_date")
|
||||
][: 5 - len(suggestions)]
|
||||
).order_by("-updated_date")[: 5 - len(suggestions)]
|
||||
]
|
||||
return suggestions
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue