From c05660bf839143573302bd1f11377f067ab77163 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Feb 2022 12:13:24 +0100 Subject: [PATCH] Fix 2 bugs / fiche etud --- app/models/etudiants.py | 1 + app/scodoc/sco_formsemestre_validation.py | 4 ++-- app/scodoc/sco_pvjury.py | 11 ++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/models/etudiants.py b/app/models/etudiants.py index 35c3fc85..ff91981b 100644 --- a/app/models/etudiants.py +++ b/app/models/etudiants.py @@ -123,6 +123,7 @@ class Identite(db.Model): e = dict(self.__dict__) e.pop("_sa_instance_state", None) # ScoDoc7 output_formators: (backward compat) + e["etudid"] = self.id e["date_naissance"] = ndb.DateISOtoDMY(e["date_naissance"]) return {k: e[k] or "" for k in e} # convert_null_outputs_to_empty diff --git a/app/scodoc/sco_formsemestre_validation.py b/app/scodoc/sco_formsemestre_validation.py index 138dc74f..7148ad16 100644 --- a/app/scodoc/sco_formsemestre_validation.py +++ b/app/scodoc/sco_formsemestre_validation.py @@ -560,7 +560,7 @@ def formsemestre_recap_parcours_table( else: type_sem = "" class_sem = "sem_autre" - if sem["formation_code"] != Se.formation["formation_code"]: + if sem["formation_code"] != Se.formation.formation_code: class_sem += " sem_autre_formation" if sem["bul_bgcolor"]: bgcolor = sem["bul_bgcolor"] @@ -628,7 +628,7 @@ def formsemestre_recap_parcours_table( if not sem["etat"]: # locked lockicon = scu.icontag("lock32_img", title="verrouillé", border="0") default_sem_info += lockicon - if sem["formation_code"] != Se.formation["formation_code"]: + if sem["formation_code"] != Se.formation.formation_code: default_sem_info += "Autre formation: %s" % sem["formation_code"] H.append( '%s%s' diff --git a/app/scodoc/sco_pvjury.py b/app/scodoc/sco_pvjury.py index aa741c0a..82871908 100644 --- a/app/scodoc/sco_pvjury.py +++ b/app/scodoc/sco_pvjury.py @@ -101,11 +101,12 @@ def _descr_decisions_ues(nt, etudid, decisions_ue, decision_sem): except: log("descr_decisions_ues: ue_id=%s decisions_ue=%s" % (ue_id, decisions_ue)) # Les UE capitalisées dans d'autres semestres: - for ue_id in nt.validations.ue_capitalisees.loc[etudid]["ue_id"]: - try: - uelist.append(nt.get_etud_ue_status(etudid, ue_id)["ue"]) - except KeyError: - pass + if etudid in nt.validations.ue_capitalisees.index: + for ue_id in nt.validations.ue_capitalisees.loc[etudid]["ue_id"]: + try: + uelist.append(nt.get_etud_ue_status(etudid, ue_id)["ue"]) + except KeyError: + pass uelist.sort(key=itemgetter("numero")) return uelist