Merge pull request #1875 from bookwyrm-social/get-started-books

Don't check suggested books against shelved books
This commit is contained in:
Mouse Reeve 2022-01-27 12:43:04 -08:00 committed by GitHub
commit 2cf10b932d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,14 +57,7 @@ class GetStartedBooks(View):
if len(book_results) < 5:
popular_books = (
models.Edition.objects.exclude(
# exclude already shelved
Q(
parent_work__in=[
b.book.parent_work
for b in request.user.shelfbook_set.distinct().all()
]
)
| Q( # and exclude if it's already in search results
Q( # exclude if it's already in search results
parent_work__in=[b.parent_work for b in book_results]
)
)