Skip to content

Commit

Permalink
Use a simpler query for books to show on the landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse-reeve committed Jun 8, 2024
1 parent 3545a1c commit 3f08d6d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions bookwyrm/templatetags/landing_page_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
)

0 comments on commit 3f08d6d

Please sign in to comment.