diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index a533fb80..13af9dea 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -330,11 +330,13 @@ class BulletinBUT: return d - def bulletin_etud_complet(self, etud: Identite) -> dict: + def bulletin_etud_complet(self, etud: Identite, version="long") -> dict: """Bulletin dict complet avec toutes les infos pour les bulletins BUT pdf Résultat compatible avec celui de sco_bulletins.formsemestre_bulletinetud_dict """ - d = self.bulletin_etud(etud, self.res.formsemestre, force_publishing=True) + d = self.bulletin_etud( + etud, self.res.formsemestre, version=version, force_publishing=True + ) d["etudid"] = etud.id d["etud"] = d["etudiant"] d["etud"]["nomprenom"] = etud.nomprenom diff --git a/app/but/bulletin_but_pdf.py b/app/but/bulletin_but_pdf.py index 6a317684..5263091a 100644 --- a/app/but/bulletin_but_pdf.py +++ b/app/but/bulletin_but_pdf.py @@ -35,11 +35,14 @@ class BulletinGeneratorStandardBUT(BulletinGeneratorStandard): tables_infos = [ # ---- TABLE SYNTHESE UES self.but_table_synthese_ues(), - # ---- TABLE RESSOURCES - self.but_table_ressources(), - # ---- TABLE SAE - self.but_table_saes(), ] + if self.version != "short": + tables_infos += [ + # ---- TABLE RESSOURCES + self.but_table_ressources(), + # ---- TABLE SAE + self.but_table_saes(), + ] objects = [] for i, (col_keys, rows, pdf_style, col_widths) in enumerate(tables_infos): table = gen_tables.GenTable( diff --git a/app/scodoc/sco_bulletins.py b/app/scodoc/sco_bulletins.py index 65dcb3a9..b9ebdfcc 100644 --- a/app/scodoc/sco_bulletins.py +++ b/app/scodoc/sco_bulletins.py @@ -885,7 +885,7 @@ def do_formsemestre_bulletinetud( if formsemestre.formation.is_apc(): etud = Identite.query.get(etudid) r = bulletin_but.BulletinBUT(formsemestre) - I = r.bulletin_etud_complet(etud) + I = r.bulletin_etud_complet(etud, version=version) else: I = formsemestre_bulletinetud_dict(formsemestre.id, etudid) etud = I["etud"] @@ -980,7 +980,7 @@ def mail_bulletin(formsemestre_id, I, pdfdata, filename, recipient_addr): except KeyError as e: raise ScoValueError( "format 'Message d'accompagnement' (bul_intro_mail) invalide, revoir les réglages dans les préférences" - ) + ) from e else: hea = "" @@ -1011,97 +1011,6 @@ def mail_bulletin(formsemestre_id, I, pdfdata, filename, recipient_addr): ) -def _formsemestre_bulletinetud_header_html_old_XXX( - etud: Identite, - formsemestre: FormSemestre, - format=None, - version=None, -): - H = [ - html_sco_header.sco_header( - page_title=f"Bulletin de {etud.nomprenom}", - javascripts=[ - "js/bulletin.js", - "libjs/d3.v3.min.js", - "js/radar_bulletin.js", - ], - cssstyles=["css/radar_bulletin.css"], - ), - f"""
- {etud.nomprenom}- - | %s - """ - % ( - url_for("scolar.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etud.id), - sco_photos.etud_photo_html(etud, title="fiche de " + etud.nomprenom), - ) - ) - H.append( - """ |