mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-08-03 15:11:40 +00:00
Do not throw an exception, when cloning an private attachment
Fixes issue #1473
This commit is contained in:
parent
24c5a92e46
commit
e11eff5e45
1 changed files with 3 additions and 2 deletions
|
|
@ -189,8 +189,9 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if attach.secure and not is_granted('show_private', attach) %}
|
||||
{# Leave blank #}
|
||||
{% if attach.secure and (not is_granted('show_private', attach) or attach.id is null) %}
|
||||
{# Leave blank: either the user is not allowed to see private attachments, or the attachment
|
||||
(e.g. from a cloned part) has not been saved yet, so no view URL can be generated for it #}
|
||||
{% elseif attach.picture %}
|
||||
<a href="{{ entity_url(attach, 'file_view') }}" rel="noopener" target="_blank" data-turbo="false">
|
||||
<img class="img-fluid img-thumbnail thumbnail-sm" src="{{ attachment_thumbnail(attach, 'thumbnail_md') }}" alt="{% trans %}attachment.preview.alt{% endtrans %}" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue