Skip to content

Commit d84936c

Browse files
committed
Fixes category filter
1 parent 4a7aecc commit d84936c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/books/categories.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h2>Categories</h2>
3434
<tbody>
3535
{% for category in categories %}
3636
<tr>
37-
<td>{{ category.name }}</td>
37+
<td><a href="{% url 'books_index_category' category.slug %}" target="_blank">{{ category.name }} <i class="fa fa-external-link" aria-hidden="true"></i></a></td>
3838
<td>{{ category.book_set.count }}</td>
3939
<td><a href="{% url 'books_edit_category' category.pk %}"
4040
class="button secondary small">Edit</a></td>

views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def index(request, category_slug=None):
2424
models.Category,
2525
slug=category_slug,
2626
)
27-
books.filter(category=category)
27+
books = books.filter(category=category)
2828

2929
template = 'books/index.html'
3030
context = {

0 commit comments

Comments
 (0)