From 62e57d9ca0847ab12a2db0fab0a4888f5c1d7ca7 Mon Sep 17 00:00:00 2001 From: leonard_montalbano Date: Fri, 20 May 2022 16:28:41 +0200 Subject: [PATCH] premiers essais pdf bulletin etud sem --- app/api/etudiants.py | 4 ++-- app/scodoc/sco_bulletins_pdf.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/api/etudiants.py b/app/api/etudiants.py index 1b11fa6f..6bf1cc3f 100644 --- a/app/api/etudiants.py +++ b/app/api/etudiants.py @@ -18,7 +18,7 @@ from app.api.tools import get_last_instance_etud_from_etudid_or_nip_or_ine from app.models import Departement, FormSemestreInscription, FormSemestre, Identite from app.scodoc import sco_bulletins from app.scodoc import sco_groups -from app.scodoc.sco_bulletins_pdf import get_etud_bulletins_pdf, get_bulletin_etud_formsemestre +from app.scodoc.sco_bulletins_pdf import get_bulletin_etud_formsemestre_pdf from app.scodoc.sco_permissions import Permission @@ -464,7 +464,7 @@ def etudiant_bulletin_semestre( # XXX TODO Ajouter la possibilité de retourner app.set_sco_dept(dept.acronym) if pdf: - return get_bulletin_etud_formsemestre(etudid, formsemestre_id, version) + return get_bulletin_etud_formsemestre_pdf(etudid, formsemestre_id, version) return sco_bulletins.get_formsemestre_bulletin_etud_json( diff --git a/app/scodoc/sco_bulletins_pdf.py b/app/scodoc/sco_bulletins_pdf.py index 8d10b37f..7fc8f983 100644 --- a/app/scodoc/sco_bulletins_pdf.py +++ b/app/scodoc/sco_bulletins_pdf.py @@ -75,7 +75,7 @@ import sco_version def assemble_bulletins_pdf( formsemestre_id: int, - story: list, + story, bul_title: str, infos, pagesbookmarks=None, @@ -107,7 +107,7 @@ def assemble_bulletins_pdf( preferences=sco_preferences.SemPreferences(formsemestre_id), ) ) - document.multiBuild(story) + document.build(story) data = report.getvalue() return data @@ -281,19 +281,19 @@ def get_bulletin_etud_formsemestre_pdf(etudid: int, formsemestre_id: int, versio from app.scodoc import sco_bulletins etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0] - fragments = [] + # fragments = [] bookmarks = {} filigrannes = {} formsemestre = FormSemestre.query.get(formsemestre_id) - frag, filigranne = sco_bulletins.do_formsemestre_bulletinetud( + fragments, filigranne = sco_bulletins.do_formsemestre_bulletinetud( formsemestre, etudid, format="pdfpart", version=version, ) - # fragments += frag - # filigrannes[i] = filigranne + # fragments.append(frag) + filigrannes[0] = filigranne # bookmarks[i] = sem["session_id"] # eg RT-DUT-FI-S1-2015 infos = {"DeptName": sco_preferences.get_preference("DeptName")} @@ -304,7 +304,7 @@ def get_bulletin_etud_formsemestre_pdf(etudid: int, formsemestre_id: int, versio try: sco_pdf.PDFLOCK.acquire() pdfdoc = assemble_bulletins_pdf( - None, + formsemestre_id, fragments, etud["nomprenom"], infos,