Don't check suggested books against shelved books
It takes too long, and ideally this is your first action so you don't have any books shelved yet.
This commit is contained in:
parent
91f085c876
commit
c0dabeee04
|
@ -57,14 +57,7 @@ class GetStartedBooks(View):
|
||||||
if len(book_results) < 5:
|
if len(book_results) < 5:
|
||||||
popular_books = (
|
popular_books = (
|
||||||
models.Edition.objects.exclude(
|
models.Edition.objects.exclude(
|
||||||
# exclude already shelved
|
Q( # exclude if it's already in search results
|
||||||
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
|
|
||||||
parent_work__in=[b.parent_work for b in book_results]
|
parent_work__in=[b.parent_work for b in book_results]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue