From 875c12d703ea2e888d0cc09591caeed3ff15754b Mon Sep 17 00:00:00 2001 From: Jean-Marie PLACE Date: Tue, 22 Feb 2022 19:25:49 +0100 Subject: [PATCH] soften error when logo not found --- app/scodoc/sco_logos.py | 2 +- app/views/scodoc.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/scodoc/sco_logos.py b/app/scodoc/sco_logos.py index c489510b..46e0c066 100644 --- a/app/scodoc/sco_logos.py +++ b/app/scodoc/sco_logos.py @@ -276,7 +276,7 @@ class Logo: if self.mm is None: return f'' else: - return f'' + return f'' def last_modified(self): path = Path(self.filepath) diff --git a/app/views/scodoc.py b/app/views/scodoc.py index 809d8e46..d1c842dd 100644 --- a/app/views/scodoc.py +++ b/app/views/scodoc.py @@ -304,8 +304,9 @@ def _return_logo(name="header", dept_id="", small=False, strict: bool = True): # stockée dans /opt/scodoc-data/config/logos donc servie manuellement ici # from app.scodoc.sco_photos import _http_jpeg_file - logo = sco_logos.find_logo(name, dept_id, strict).select() + logo = sco_logos.find_logo(name, dept_id, strict) if logo is not None: + logo.select() suffix = logo.suffix if small: with PILImage.open(logo.filepath) as im: