From de93beca84e5f2dcee9922486d99b6cc662a4525 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 20 Oct 2021 17:51:42 -0700 Subject: [PATCH] Adds shelve buttons to books on author page --- bookwyrm/templates/author/author.html | 1 + bookwyrm/views/author.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/author/author.html b/bookwyrm/templates/author/author.html index 5310f0df8..6a67b50b3 100644 --- a/bookwyrm/templates/author/author.html +++ b/bookwyrm/templates/author/author.html @@ -110,6 +110,7 @@ {% for book in books %}
{% include 'landing/small-book.html' with book=book %} + {% include 'snippets/shelve_button/shelve_button.html' with book=book %}
{% endfor %} diff --git a/bookwyrm/views/author.py b/bookwyrm/views/author.py index 1265ad689..9a3d582d6 100644 --- a/bookwyrm/views/author.py +++ b/bookwyrm/views/author.py @@ -29,7 +29,7 @@ class Author(View): ).order_by("-edition_rank") books = ( - models.Edition.objects.filter( + models.Edition.viewer_aware_objects(request.user).filter( Q(authors=author) | Q(parent_work__authors=author) ) .annotate(default_id=Subquery(default_editions.values("id")[:1]))