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"])