Skip to content

Commit

Permalink
rollback fix(forum_attachment) missing file in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Sep 18, 2023
1 parent 83c723b commit ca898af
Showing 1 changed file with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>&nbsp;{{ 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>&nbsp;{{ 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 %}

0 comments on commit ca898af

Please sign in to comment.