get_etud_ue_status: ignore error if missing etud

This commit is contained in:
Emmanuel Viennet 2024-02-26 12:54:18 +01:00
parent c0a965d774
commit 49a5ec488d
3 changed files with 4 additions and 6 deletions

View File

@ -432,7 +432,7 @@ class ResultatsSemestre(ResultatsCache):
ue_cap_dict["compense_formsemestre_id"] = None
return ue_cap_dict
def get_etud_ue_status(self, etudid: int, ue_id: int) -> dict:
def get_etud_ue_status(self, etudid: int, ue_id: int) -> dict | None:
"""L'état de l'UE pour cet étudiant.
Result: dict, ou None si l'UE n'est pas dans ce semestre.
{
@ -470,7 +470,7 @@ class ResultatsSemestre(ResultatsCache):
"ects": 0.0,
"ects_ue": ue.ects,
}
if not ue_id in self.etud_moy_ue:
if not ue_id in self.etud_moy_ue or not etudid in self.etud_moy_ue[ue_id]:
return None
if not self.validations:
self.validations = res_sem.load_formsemestre_validations(self.formsemestre)

View File

@ -72,9 +72,7 @@ def etud_get_poursuite_info(sem: dict, etud: dict) -> dict:
moy_ues.append(
(
ue["acronyme"],
scu.fmt_note(
nt.get_etud_ue_status(etudid, ue["ue_id"])["moy"]
),
scu.fmt_note(ue_status["moy"]),
)
)
else:

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.6.945"
SCOVERSION = "9.6.946"
SCONAME = "ScoDoc"