forked from ScoDoc/DocScoDoc
Merge pull request 'soften error when logo not found' (#322) from jmplace/ScoDoc-Lille:soften_logos_error_message into master
Reviewed-on: https://scodoc.org/git/ScoDoc/ScoDoc/pulls/322
This commit is contained in:
commit
bd33b288db
@ -276,7 +276,7 @@ class Logo:
|
|||||||
if self.mm is None:
|
if self.mm is None:
|
||||||
return f'<logo name="{self.logoname}" width="?? mm" height="?? mm">'
|
return f'<logo name="{self.logoname}" width="?? mm" height="?? mm">'
|
||||||
else:
|
else:
|
||||||
return f'<logo name="{self.logoname}" width="{self.mm[0]}mm"">'
|
return f'<logo name="{self.logoname}" width="{self.mm[0]}mm">'
|
||||||
|
|
||||||
def last_modified(self):
|
def last_modified(self):
|
||||||
path = Path(self.filepath)
|
path = Path(self.filepath)
|
||||||
|
@ -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
|
# stockée dans /opt/scodoc-data/config/logos donc servie manuellement ici
|
||||||
# from app.scodoc.sco_photos import _http_jpeg_file
|
# 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:
|
if logo is not None:
|
||||||
|
logo.select()
|
||||||
suffix = logo.suffix
|
suffix = logo.suffix
|
||||||
if small:
|
if small:
|
||||||
with PILImage.open(logo.filepath) as im:
|
with PILImage.open(logo.filepath) as im:
|
||||||
|
Loading…
Reference in New Issue
Block a user