]> git.0d.be Git - panikweb-studioneau.git/commitdiff
protect against empty tag slug
authorFrédéric Péters <fpeters@0d.be>
Tue, 21 Mar 2023 15:23:56 +0000 (16:23 +0100)
committerFrédéric Péters <fpeters@0d.be>
Tue, 21 Mar 2023 15:23:56 +0000 (16:23 +0100)
(this happens for example with "/" used as tag)

panikweb_studioneau/templates/includes/tags.html

index d20921f7c7b2e89fc66b9d8415b6b01d0fd6541d..8cbda1468d767d19ab38d76abd07dea3524be83a 100644 (file)
@@ -1 +1 @@
-{% if not nothing_if_empty or object.tags.exists %}<div class="{% if object.tags.exists %}tags{% else %}tags-will-be-here{% endif %}">{% for tag in object.tags.all %}<a href="{% url 'tag-items' slug=tag.slug %}">{{ tag }}</a> {% endfor %}</div>{% endif %}
+{% if not nothing_if_empty or object.tags.exists %}<div class="{% if object.tags.exists %}tags{% else %}tags-will-be-here{% endif %}">{% for tag in object.tags.all %}{% if tag.slug %}<a href="{% url 'tag-items' slug=tag.slug %}">{{ tag }}</a> {% endif %}{% endfor %}</div>{% endif %}