diff --git a/bookwyrm/templates/lists/list_items.html b/bookwyrm/templates/lists/list_items.html index 4560147f..942579ca 100644 --- a/bookwyrm/templates/lists/list_items.html +++ b/bookwyrm/templates/lists/list_items.html @@ -9,8 +9,8 @@
- {% for book in list.books.all|slice:5 %} - {% include 'snippets/book_cover.html' with book=book size="small" %} + {% for book in list.listitem_set.all|slice:5 %} + {% include 'snippets/book_cover.html' with book=book.book size="small" %} {% endfor %}
diff --git a/bookwyrm/templates/lists/lists.html b/bookwyrm/templates/lists/lists.html index ad2dfbaf..96ad8153 100644 --- a/bookwyrm/templates/lists/lists.html +++ b/bookwyrm/templates/lists/lists.html @@ -33,9 +33,7 @@ {% if lists %}

Recent Lists

- {% if request.user.list_set.exists %} {% include 'lists/list_items.html' with lists=lists %} - {% endif %}
{% include 'snippets/pagination.html' with page=lists path=path %} diff --git a/bookwyrm/views/list.py b/bookwyrm/views/list.py index ce0cedb4..88938a67 100644 --- a/bookwyrm/views/list.py +++ b/bookwyrm/views/list.py @@ -29,6 +29,7 @@ class Lists(View): user = request.user if request.user.is_authenticated else None lists = models.List.objects.filter( ~Q(user=user), + books__isnull=False, ).all() lists = privacy_filter(request.user, lists, ['public', 'followers'])