Fix tag display page

This commit is contained in:
Alexandre Iooss 2021-10-13 14:19:04 +02:00
parent 292f8e6298
commit 5985b39ed8
2 changed files with 2 additions and 2 deletions

View file

@ -26,7 +26,7 @@
{% if gallery.extended.tags.all %}
<p class="text-muted">
Tags : {% for tag in gallery.extended.tags.all %}
<a class="badge rounded-pill bg-dark text-decoration-none" href="{% url 'tag-detail' tag %}">{{ tag }}</a>
<a class="badge rounded-pill bg-dark text-decoration-none" href="{% url 'tag-detail' tag.slug %}">{{ tag }}</a>
{% endfor %}
</p>
{% endif %}

View file

@ -23,7 +23,7 @@ class TagDetail(LoginRequiredMixin, DetailView):
current_tag = self.get_object().slug
context = super().get_context_data(**kwargs)
context['galleries'] = Gallery.objects.on_site().is_public() \
.filter(extended__tags__name=current_tag)
.filter(extended__tags__slug=current_tag)
return context