1
0
forked from ScoDoc/ScoDoc

API /formsemestre/<int:formsemestre_id>/decisions_jury : ajout décision BUT annuelle

This commit is contained in:
Emmanuel Viennet 2024-09-30 02:51:06 +02:00
parent f10dd46abb
commit 4717361f8b
2 changed files with 20 additions and 6 deletions

View File

@ -54,6 +54,7 @@ from app.scodoc.sco_utils import json_error
@as_json @as_json
def decisions_jury(formsemestre_id: int): def decisions_jury(formsemestre_id: int):
"""Décisions du jury des étudiants du formsemestre. """Décisions du jury des étudiants du formsemestre.
(fonction disponible uniquement en BUT actuellement).
SAMPLES SAMPLES
------- -------

View File

@ -56,16 +56,20 @@ def _get_jury_but_etud_result(
rcue_dict = { rcue_dict = {
"ue_1": { "ue_1": {
"ue_id": rcue.ue_1.id, "ue_id": rcue.ue_1.id,
"moy": None "moy": (
if (dec_ue1.moy_ue is None or np.isnan(dec_ue1.moy_ue)) None
else dec_ue1.moy_ue, if (dec_ue1.moy_ue is None or np.isnan(dec_ue1.moy_ue))
else dec_ue1.moy_ue
),
"code": dec_ue1.code_valide, "code": dec_ue1.code_valide,
}, },
"ue_2": { "ue_2": {
"ue_id": rcue.ue_2.id, "ue_id": rcue.ue_2.id,
"moy": None "moy": (
if (dec_ue2.moy_ue is None or np.isnan(dec_ue2.moy_ue)) None
else dec_ue2.moy_ue, if (dec_ue2.moy_ue is None or np.isnan(dec_ue2.moy_ue))
else dec_ue2.moy_ue
),
"code": dec_ue2.code_valide, "code": dec_ue2.code_valide,
}, },
"moy": rcue.moy_rcue, "moy": rcue.moy_rcue,
@ -89,6 +93,15 @@ def _get_jury_but_etud_result(
row["semestre"] = {"code": dec_etud["decision_sem"].get("code")} row["semestre"] = {"code": dec_etud["decision_sem"].get("code")}
else: else:
row["semestre"] = {} # APC, ... row["semestre"] = {} # APC, ...
# --- L'année (BUT)
if deca and deca.validation:
row["annee"] = {
"code": deca.validation.code,
"ordre": deca.validation.ordre,
"annee_scolaire": deca.validation.annee_scolaire,
}
else:
row["annee"] = {}
# --- Autorisations # --- Autorisations
row["autorisations"] = dec_etud["autorisations"] row["autorisations"] = dec_etud["autorisations"]
return row return row