mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 10:01:04 +00:00
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
|
s.default_edition
|
||||||
for s in models.Work.objects.filter(
|
for s in models.Work.objects.filter(
|
||||||
~Q(editions__in=book_list.books.all()),
|
~Q(editions__in=book_list.books.all()),
|
||||||
).order_by("-updated_date")
|
).order_by("-updated_date")[: 5 - len(suggestions)]
|
||||||
][: 5 - len(suggestions)]
|
]
|
||||||
return suggestions
|
return suggestions
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue