diff --git a/app/comp/res_common.py b/app/comp/res_common.py index 1aa993e85..cad318972 100644 --- a/app/comp/res_common.py +++ b/app/comp/res_common.py @@ -233,24 +233,29 @@ class ResultatsSemestre(ResultatsCache): "ue": ue.to_dict(), "formsemestre_id": None, "capitalized_ue_id": None, + "ects_pot": 0.0, } cur_moy_ue = self.etud_moy_ue[ue_id][etudid] moy_ue = cur_moy_ue is_capitalized = False if etudid in self.validations.ue_capitalisees.index: ue_cap = self._get_etud_ue_cap(etudid, ue) - if ue_cap is not None and not ue_cap.empty: - if ue_cap["moy_ue"] > cur_moy_ue: + if ( + ue_cap is not None + and not ue_cap.empty + and not np.isnan(ue_cap["moy_ue"]) + ): + if ue_cap["moy_ue"] > cur_moy_ue or np.isnan(cur_moy_ue): moy_ue = ue_cap["moy_ue"] is_capitalized = True - if is_capitalized: - coef_ue = 1.0 + coef_ue = self.etud_coef_ue_df[ue_id][etudid] return { "is_capitalized": is_capitalized, "is_external": ue_cap["is_external"] if is_capitalized else ue.is_external, "coef_ue": coef_ue, + "ects_pot": ue.ects or 0.0, "cur_moy_ue": cur_moy_ue, "moy": moy_ue, "event_date": ue_cap["event_date"] if is_capitalized else None, diff --git a/app/scodoc/sco_formsemestre_validation.py b/app/scodoc/sco_formsemestre_validation.py index 425d13946..138dc74f3 100644 --- a/app/scodoc/sco_formsemestre_validation.py +++ b/app/scodoc/sco_formsemestre_validation.py @@ -702,7 +702,7 @@ def formsemestre_recap_parcours_table( ) # total ECTS (affiché sous la moyenne générale) H.append( - '