From 0e52851c91f4104e28cd2abc58538380d33c2f6c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 17 May 2022 16:38:44 +0200 Subject: Sheet: silently fails when missing graph relations image is missing --- CHANGES-DEV.md | 1 + ishtar_common/templatetags/ishtar_helpers.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES-DEV.md b/CHANGES-DEV.md index f9fd9e686..48fbd3b59 100644 --- a/CHANGES-DEV.md +++ b/CHANGES-DEV.md @@ -43,4 +43,5 @@ Ishtar develop changelog v3.2 - Search: fix url for person and organization - Geo: use own precise multipolygone centroid before parent precise point - Many to one treatment: fix attribute conservation +- Sheet: silently fails when missing graph relations image is missing diff --git a/ishtar_common/templatetags/ishtar_helpers.py b/ishtar_common/templatetags/ishtar_helpers.py index 282f35521..375f80ae7 100644 --- a/ishtar_common/templatetags/ishtar_helpers.py +++ b/ishtar_common/templatetags/ishtar_helpers.py @@ -36,7 +36,10 @@ def safe_or(item, args): @register.filter def file_content(value): if value: - return mark_safe(value.read()) + try: + return mark_safe(value.read()) + except FileNotFoundError: + pass return "" -- cgit v1.2.3