From 940dc2721a446f8f0417ec4d332692ff1cedc775 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 12 Jul 2024 16:21:27 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20jury=20BUT=20sur=20=C3=A9tudiant=20sans?= =?UTF-8?q?=20deca?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/jury_but_pv.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/but/jury_but_pv.py b/app/but/jury_but_pv.py index 1bc5a8d3..c0b07ba2 100644 --- a/app/but/jury_but_pv.py +++ b/app/but/jury_but_pv.py @@ -156,7 +156,7 @@ def pvjury_table_but( deca = None ects_but_valides = but_ects_valides(etud, referentiel_competence_id) - has_diplome = deca.valide_diplome() + has_diplome = deca.valide_diplome() if deca else False diplome_lst = ["ADM"] if has_diplome else [] validation_dut120 = ValidationDUT120.query.filter_by( etudid=etudid, formsemestre_id=formsemestre.id @@ -181,8 +181,12 @@ def pvjury_table_but( etudid=etud.id, ), "cursus": _descr_cursus_but(etud), - "ects": f"""{deca.ects_annee():g}

Tot. {ects_but_valides:g}""", - "_ects_xls": deca.ects_annee(), + "ects": ( + f"""{deca.ects_annee():g}

Tot. {ects_but_valides:g}""" + if deca + else "" + ), + "_ects_xls": deca.ects_annee() if deca else "", "ects_but": ects_but_valides, "ues": deca.descr_ues_validation(line_sep=line_sep) if deca else "-", "niveaux": ( @@ -207,7 +211,7 @@ def pvjury_table_but( "code_nip": etud.code_nip, "code_ine": etud.code_ine, } - if deca.valide_diplome() or not only_diplome: + if (deca and deca.valide_diplome()) or not only_diplome: rows.append(row) rows.sort(key=lambda x: x["_nom_pv_order"])