From ca898afa102fabfed0c6a7f4e21d1d8d5feb0685 Mon Sep 17 00:00:00 2001 From: vincent porte <vincent@neuralia.co> Date: Mon, 18 Sep 2023 17:39:09 +0200 Subject: [PATCH] rollback fix(forum_attachment) missing file in dev --- .../forum_attachments/attachments_detail.html | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lacommunaute/templates/forum_conversation/forum_attachments/attachments_detail.html b/lacommunaute/templates/forum_conversation/forum_attachments/attachments_detail.html index c56b248b2..66f321bac 100644 --- a/lacommunaute/templates/forum_conversation/forum_attachments/attachments_detail.html +++ b/lacommunaute/templates/forum_conversation/forum_attachments/attachments_detail.html @@ -6,19 +6,14 @@ {% if post.attachments.exists and user_can_download_files %} <div class="row attachments mt-3 mt-md-5"> {% for attachment in post.attachments.all %} - {% comment %}to prevent failure in dev, when files don't exist{% endcomment %} - {% if attachement %} - {% if not attachment|is_image %} - <div class="col-md-12 attachment"> - <a href="{% url 'forum_conversation:attachment' pk=attachment.id %}"><i class="fa fa-file"></i> {{ attachment.filename }} ({{ attachment.file.size|filesizeformat }})</a> - {% if attachment.comment %} - <p class="text-muted"><em>{{ attachment.comment }}</em></p> - {% endif %} - </div> - {% endif%} - {%else%} - <p class="text-muted">{{attachment.filename}}</p> - {% endif %} + {% if not attachment|is_image %} + <div class="col-md-12 attachment"> + <a href="{% url 'forum_conversation:attachment' pk=attachment.id %}"><i class="fa fa-file"></i> {{ attachment.filename }} ({{ attachment.file.size|filesizeformat }})</a> + {% if attachment.comment %} + <p class="text-muted"><em>{{ attachment.comment }}</em></p> + {% endif %} + </div> + {% endif%} {% endfor %} </div> {% endif %}