From 8df25ca02f403f2a7618a557a877c24d02c4fcca Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 24 Mar 2024 15:47:42 +0100 Subject: [PATCH] Ajout infos semestres dans bulletin classique JSON. Close #583 --- app/scodoc/sco_bulletins_json.py | 17 ++++++++++++++++- .../results/formsemestre_resultat.json | 16 ++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/scodoc/sco_bulletins_json.py b/app/scodoc/sco_bulletins_json.py index 42e2a910e..d684f03f2 100644 --- a/app/scodoc/sco_bulletins_json.py +++ b/app/scodoc/sco_bulletins_json.py @@ -89,7 +89,7 @@ def formsemestre_bulletinetud_published_dict( version="long", ) -> dict: """Dictionnaire representant les informations _publiees_ du bulletin de notes - Utilisé pour JSON, devrait l'être aussi pour XML. (todo) + Utilisé pour JSON des formations classiques (mais pas pour le XML, qui est deprecated). version: short (sans les évaluations) @@ -169,6 +169,21 @@ def formsemestre_bulletinetud_published_dict( pid = partition["partition_id"] partitions_etud_groups[pid] = sco_groups.get_etud_groups_in_partition(pid) + # Il serait préférable de factoriser et d'avoir la même section + # "semestre" que celle des bulletins BUT. + etud_groups = sco_groups.get_etud_formsemestre_groups( + etud, formsemestre, only_to_show=True + ) + d["semestre"] = { + "etapes": [str(x.etape_apo) for x in formsemestre.etapes if x.etape_apo], + "date_debut": formsemestre.date_debut.isoformat(), + "date_fin": formsemestre.date_fin.isoformat(), + "annee_universitaire": formsemestre.annee_scolaire_str(), + "numero": formsemestre.semestre_id, + "inscription": "", # inutilisé mais nécessaire pour le js de Seb. + "groupes": [group.to_dict() for group in etud_groups], + } + ues_stat = nt.get_ues_stat_dict() modimpls = nt.get_modimpls_dict() nbetuds = len(nt.etud_moy_gen_ranks) diff --git a/tests/ressources/results/formsemestre_resultat.json b/tests/ressources/results/formsemestre_resultat.json index 1c67f4066..6d1f89124 100644 --- a/tests/ressources/results/formsemestre_resultat.json +++ b/tests/ressources/results/formsemestre_resultat.json @@ -50,6 +50,7 @@ "moy_sae_15_3": "~", "bac": "", "specialite": "", + "sort_key": "fleury;madeleine", "type_admission": "", "classement": "", "partitions": { @@ -107,6 +108,7 @@ "moy_sae_15_3": "~", "bac": "", "specialite": "", + "sort_key": "saunier;jacques", "type_admission": "", "classement": "", "partitions": { @@ -163,6 +165,7 @@ "moy_sae_14_3": "05.70", "moy_sae_15_3": "~", "bac": "", + "sort_key": "lenfant;maxime", "specialite": "", "type_admission": "", "classement": "", @@ -221,6 +224,7 @@ "moy_sae_15_3": "~", "bac": "", "specialite": "", + "sort_key": "cuny;camille", "type_admission": "", "classement": "", "partitions": { @@ -277,6 +281,7 @@ "moy_sae_14_3": "11.09", "moy_sae_15_3": "~", "bac": "", + "sort_key": "mouton;claude", "specialite": "", "type_admission": "", "classement": "", @@ -335,6 +340,7 @@ "moy_sae_15_3": "~", "bac": "", "specialite": "", + "sort_key": "regnier;patrick", "type_admission": "", "classement": "", "partitions": { @@ -391,6 +397,7 @@ "moy_sae_14_3": "05.17", "moy_sae_15_3": "~", "bac": "", + "sort_key": "esteve;alix", "specialite": "", "type_admission": "", "classement": "", @@ -448,6 +455,7 @@ "moy_sae_14_3": "03.32", "moy_sae_15_3": "~", "bac": "", + "sort_key": "gilles;maxime", "specialite": "", "type_admission": "", "classement": "", @@ -505,6 +513,7 @@ "moy_sae_14_3": "02.10", "moy_sae_15_3": "~", "bac": "", + "sort_key": "naudin;simone", "specialite": "", "type_admission": "", "classement": "", @@ -562,6 +571,7 @@ "moy_sae_14_3": "07.17", "moy_sae_15_3": "~", "bac": "", + "sort_key": "costa;sacha", "specialite": "", "type_admission": "", "classement": "", @@ -619,6 +629,7 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "bac": "", + "sort_key": "gautier;gerard", "specialite": "", "type_admission": "", "classement": "", @@ -676,6 +687,7 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "bac": "", + "sort_key": "villeneuve;francoise", "specialite": "", "type_admission": "", "classement": "", @@ -733,6 +745,7 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "bac": "", + "sort_key": "schmitt;emmanuel", "specialite": "", "type_admission": "", "classement": "", @@ -790,6 +803,7 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "bac": "", + "sort_key": "boutet;marguerite", "specialite": "", "type_admission": "", "classement": "", @@ -848,6 +862,7 @@ "moy_sae_15_3": "", "bac": "", "specialite": "", + "sort_key": "rollin;derchen", "type_admission": "", "classement": "", "partitions": { @@ -904,6 +919,7 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "bac": "", + "sort_key": "diot;camille", "specialite": "", "type_admission": "", "classement": "",