Deduplicate books on tag page

This commit is contained in:
Mouse Reeve 2020-02-21 09:32:24 -08:00
parent cb6b98992c
commit 19109b98fa

View file

@ -244,7 +244,7 @@ def author_page(request, author_identifier):
def tag_page(request, tag_id): def tag_page(request, tag_id):
''' books related to a tag ''' ''' books related to a tag '''
tag_obj = models.Tag.objects.filter(identifier=tag_id).first() tag_obj = models.Tag.objects.filter(identifier=tag_id).first()
books = models.Book.objects.filter(tag__identifier=tag_id) books = models.Book.objects.filter(tag__identifier=tag_id).distinct()
data = { data = {
'books': books, 'books': books,
'tag': tag_obj, 'tag': tag_obj,