Merge pull request #2437 from cincodenada/fix/list-suggestions

Fix: Slice queryset in list suggestions before we resolve it
This commit is contained in:
Mouse Reeve 2022-11-23 21:47:05 -08:00 committed by GitHub
commit 2e882a447f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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