diff --git a/bookwyrm/templates/about/about.html b/bookwyrm/templates/about/about.html index 5aa68d1e0..fda8fb529 100644 --- a/bookwyrm/templates/about/about.html +++ b/bookwyrm/templates/about/about.html @@ -29,8 +29,8 @@
- {% blocktrans trimmed with title=top_rated|book_title site_name=site.name rating=top_rated.rating|floatformat:1 %} - {{ title }} is {{ site_name }}'s most beloved book, with an average rating of {{ rating }} out of 5. + {% blocktrans trimmed with title=top_rated|book_title book_path=book.local_path site_name=site.name rating=top_rated.rating|floatformat:1 %} + {{ title }} is {{ site_name }}'s most beloved book, with an average rating of {{ rating }} out of 5. {% endblocktrans %}
@@ -43,8 +43,8 @@
- {% blocktrans trimmed with title=wanted|book_title site_name=site.name %} - More {{ site_name }} users want to read {{ title }}. + {% blocktrans trimmed with title=wanted|book_title book_path=book.local_path site_name=site.name %} + More {{ site_name }} users want to read {{ title }}. {% endblocktrans %}
@@ -57,8 +57,8 @@
- {% blocktrans trimmed with title=controversial|book_title site_name=site.name %} - {{ title }} has the most divisive ratings of any book on {{ site_name }}. + {% blocktrans trimmed with title=controversial|book_title book_path=book.local_path site_name=site.name %} + {{ title }} has the most divisive ratings of any book on {{ site_name }}. {% endblocktrans %}
diff --git a/bookwyrm/views/landing/landing.py b/bookwyrm/views/landing/landing.py index 995d923ec..19a14851e 100644 --- a/bookwyrm/views/landing/landing.py +++ b/bookwyrm/views/landing/landing.py @@ -29,17 +29,17 @@ def about(request): books = models.Edition.objects.exclude(cover__exact="") - total_ratings = models.Review.objects.filter(user__local=True).count() + total_ratings = models.Review.objects.filter(user__local=True, deleted=False).count() data["top_rated"] = books.annotate( - rating=Avg("review__rating", filter=Q(review__user__local=True)), - rating_count=Count("review__rating", filter=Q(review__user__local=True)), + rating=Avg("review__rating", filter=Q(review__user__local=True, review__deleted=False)), + rating_count=Count("review__rating", filter=Q(review__user__local=True, review__deleted=False)), ).annotate( weighted=F("rating") * F("rating_count") / total_ratings ).filter(weighted__gt=0).order_by("-weighted").first() data["controversial"] = books.annotate( - deviation=StdDev("review__rating", filter=Q(review__user__local=True)), - rating_count=Count("review__rating", filter=Q(review__user__local=True)), + deviation=StdDev("review__rating", filter=Q(review__user__local=True, review__deleted=False)), + rating_count=Count("review__rating", filter=Q(review__user__local=True, review__deleted=False)), ).annotate( weighted=F("deviation") * F("rating_count") / total_ratings ).filter(weighted__gt=0).order_by("-weighted").first()