avoid error on bad book data in discover page

This commit is contained in:
Mouse Reeve 2020-04-01 16:21:11 -07:00
parent ae37e5b9d9
commit cfff75764b

View file

@ -143,7 +143,7 @@ def books_page(request):
if request.user.is_authenticated:
recent_books = models.Edition.objects.filter(
~Q(shelfbook__shelf__user=request.user),
id__in=[b.id for b in recent_books],
id__in=[b.id for b in recent_books if b],
)
data = {