From a47faa0115e74579109ab09e9f971f827fbfe764 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 26 Jan 2022 14:27:55 +0100 Subject: [PATCH] Fix PE generation --- app/pe/pe_tools.py | 2 +- app/pe/pe_view.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/pe/pe_tools.py b/app/pe/pe_tools.py index a495f965..2c9dd230 100644 --- a/app/pe/pe_tools.py +++ b/app/pe/pe_tools.py @@ -206,7 +206,7 @@ def add_pe_stuff_to_zip(zipfile, ziproot): for name in logos_names: logo = find_logo(logoname=name, dept_id=g.scodoc_dept_id) if logo is not None: - add_local_file_to_zip(zipfile, ziproot, logo, "avis/logos/" + logo.filename) + add_local_file_to_zip(zipfile, ziproot, logo.filepath, "avis/logos/" + logo.filename) # ---------------------------------------------------------------------------------------- diff --git a/app/pe/pe_view.py b/app/pe/pe_view.py index 43a00ebe..5a98d375 100644 --- a/app/pe/pe_view.py +++ b/app/pe/pe_view.py @@ -97,7 +97,7 @@ def pe_view_sem_recap( template_latex = "" # template fourni via le formulaire Web if avis_tmpl_file: - template_latex = avis_tmpl_file.read() + template_latex = avis_tmpl_file.read().decode('utf-8') template_latex = template_latex else: # template indiqué dans préférences ScoDoc ? @@ -114,7 +114,7 @@ def pe_view_sem_recap( footer_latex = "" # template fourni via le formulaire Web if footer_tmpl_file: - footer_latex = footer_tmpl_file.read() + footer_latex = footer_tmpl_file.read().decode('utf-8') footer_latex = footer_latex else: footer_latex = pe_avislatex.get_code_latex_from_scodoc_preference(