1
0
forked from ScoDoc/ScoDoc

Fix: recherche images fond de page (logos)

This commit is contained in:
Emmanuel Viennet 2022-02-26 11:00:08 +01:00
parent 9b27503d01
commit dbab59039c
3 changed files with 13 additions and 3 deletions

View File

@ -220,12 +220,16 @@ class ScolarsPageTemplate(PageTemplate):
PageTemplate.__init__(self, "ScolarsPageTemplate", [content]) PageTemplate.__init__(self, "ScolarsPageTemplate", [content])
self.logo = None self.logo = None
logo = find_logo( logo = find_logo(
logoname="bul_pdf_background", dept_id=g.scodoc_dept_id, prefix=None logoname="bul_pdf_background", dept_id=g.scodoc_dept_id
) or find_logo(
logoname="bul_pdf_background", dept_id=g.scodoc_dept_id, prefix=""
) )
if logo is None: if logo is None:
# Also try to use PV background # Also try to use PV background
logo = find_logo( logo = find_logo(
logoname="letter_background", dept_id=g.scodoc_dept_id, prefix=None logoname="letter_background", dept_id=g.scodoc_dept_id
) or find_logo(
logoname="letter_background", dept_id=g.scodoc_dept_id, prefix=""
) )
if logo is not None: if logo is not None:
self.background_image_filename = logo.filepath self.background_image_filename = logo.filepath

View File

@ -206,12 +206,18 @@ class CourrierIndividuelTemplate(PageTemplate):
background = find_logo( background = find_logo(
logoname="pvjury_background", logoname="pvjury_background",
dept_id=g.scodoc_dept_id, dept_id=g.scodoc_dept_id,
) or find_logo(
logoname="pvjury_background",
dept_id=g.scodoc_dept_id,
prefix="", prefix="",
) )
else: else:
background = find_logo( background = find_logo(
logoname="letter_background", logoname="letter_background",
dept_id=g.scodoc_dept_id, dept_id=g.scodoc_dept_id,
) or find_logo(
logoname="letter_background",
dept_id=g.scodoc_dept_id,
prefix="", prefix="",
) )
if not self.background_image_filename and background is not None: if not self.background_image_filename and background is not None:

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.1.64" SCOVERSION = "9.1.65"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"