Merge pull request #3374 from bookwyrm-social/landing-page-books

Use a simpler query for books to show on the landing page
This commit is contained in:
Mouse Reeve 2024-07-27 08:47:02 -07:00 committed by GitHub
commit 300eeac0e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,14 +71,8 @@ def get_landing_books():
"""list of books for the landing page"""
return list(
set(
models.Edition.objects.filter(
review__published_date__isnull=False,
review__deleted=False,
review__user__local=True,
review__privacy__in=["public", "unlisted"],
)
.exclude(cover__exact="")
models.Edition.objects.exclude(cover__exact="")
.distinct()
.order_by("-review__published_date")[:6]
.order_by("-updated_date")[:6]
)
)