forked from ScoDoc/ScoDoc
Bulletins BUT JSON: décisions de jury et situation
This commit is contained in:
parent
78c7c1a763
commit
b153c9ad9e
@ -16,7 +16,7 @@ from app.comp import moy_ue, moy_sem, inscr_mod
|
|||||||
from app.models import ModuleImpl
|
from app.models import ModuleImpl
|
||||||
from app.scodoc import sco_utils as scu
|
from app.scodoc import sco_utils as scu
|
||||||
from app.scodoc.sco_cache import ResultatsSemestreBUTCache
|
from app.scodoc.sco_cache import ResultatsSemestreBUTCache
|
||||||
from app.scodoc.sco_exceptions import ScoFormatError
|
from app.scodoc import sco_bulletins_json
|
||||||
from app.scodoc import sco_preferences
|
from app.scodoc import sco_preferences
|
||||||
from app.scodoc.sco_utils import jsnan, fmt_note
|
from app.scodoc.sco_utils import jsnan, fmt_note
|
||||||
|
|
||||||
@ -237,23 +237,21 @@ class ResultatsSemestreBUT:
|
|||||||
"options": bulletin_option_affichage(formsemestre),
|
"options": bulletin_option_affichage(formsemestre),
|
||||||
}
|
}
|
||||||
semestre_infos = {
|
semestre_infos = {
|
||||||
"etapes": { # XXX TODO
|
"etapes": [str(x.etape_apo) for x in formsemestre.etapes if x.etape_apo],
|
||||||
# à spécifier: liste des étapes Apogée
|
|
||||||
},
|
|
||||||
"date_debut": formsemestre.date_debut.isoformat(),
|
"date_debut": formsemestre.date_debut.isoformat(),
|
||||||
"date_fin": formsemestre.date_fin.isoformat(),
|
"date_fin": formsemestre.date_fin.isoformat(),
|
||||||
"annee_universitaire": self.formsemestre.annee_scolaire_str(),
|
"annee_universitaire": self.formsemestre.annee_scolaire_str(),
|
||||||
"inscription": "TODO-MM-JJ", # XXX TODO
|
"inscription": "TODO-MM-JJ", # XXX TODO
|
||||||
"numero": formsemestre.semestre_id,
|
"numero": formsemestre.semestre_id,
|
||||||
"decision": None, # XXX TODO
|
|
||||||
"situation": "non disponible", # "Décision jury: Validé. Diplôme obtenu.", # XXX TODO
|
|
||||||
"date_jury": "AAAA-MM-JJ", # XXX TODO
|
|
||||||
"groupes": [], # XXX TODO
|
"groupes": [], # XXX TODO
|
||||||
"absences": { # XXX TODO
|
"absences": { # XXX TODO
|
||||||
"injustifie": 1,
|
"injustifie": 1,
|
||||||
"total": 33,
|
"total": 33,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
semestre_infos.update(
|
||||||
|
sco_bulletins_json.dict_decision_jury(etud.id, formsemestre.id)
|
||||||
|
)
|
||||||
if etat_inscription == scu.INSCRIT:
|
if etat_inscription == scu.INSCRIT:
|
||||||
semestre_infos.update(
|
semestre_infos.update(
|
||||||
{
|
{
|
||||||
|
@ -334,19 +334,44 @@ def formsemestre_bulletinetud_published_dict(
|
|||||||
d["absences"] = dict(nbabs=nbabs, nbabsjust=nbabsjust)
|
d["absences"] = dict(nbabs=nbabs, nbabsjust=nbabsjust)
|
||||||
|
|
||||||
# --- Decision Jury
|
# --- Decision Jury
|
||||||
|
d.update(
|
||||||
|
dict_decision_jury(etudid, formsemestre_id, with_decisions=xml_with_decisions)
|
||||||
|
)
|
||||||
|
# --- Appreciations
|
||||||
|
cnx = ndb.GetDBConnexion()
|
||||||
|
apprecs = sco_etud.appreciations_list(
|
||||||
|
cnx, args={"etudid": etudid, "formsemestre_id": formsemestre_id}
|
||||||
|
)
|
||||||
|
d["appreciation"] = []
|
||||||
|
for app in apprecs:
|
||||||
|
d["appreciation"].append(
|
||||||
|
dict(
|
||||||
|
comment=scu.quote_xml_attr(app["comment"]),
|
||||||
|
date=ndb.DateDMYtoISO(app["date"]),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
return d
|
||||||
|
|
||||||
|
|
||||||
|
def dict_decision_jury(etudid, formsemestre_id, with_decisions=False):
|
||||||
|
"dict avec decision pour bulletins json"
|
||||||
|
from app.scodoc import sco_bulletins
|
||||||
|
|
||||||
|
d = {}
|
||||||
if (
|
if (
|
||||||
sco_preferences.get_preference("bul_show_decision", formsemestre_id)
|
sco_preferences.get_preference("bul_show_decision", formsemestre_id)
|
||||||
or xml_with_decisions
|
or with_decisions
|
||||||
):
|
):
|
||||||
infos, dpv = sco_bulletins.etud_descr_situation_semestre(
|
infos, dpv = sco_bulletins.etud_descr_situation_semestre(
|
||||||
etudid,
|
etudid,
|
||||||
formsemestre_id,
|
formsemestre_id,
|
||||||
format="xml",
|
|
||||||
show_uevalid=sco_preferences.get_preference(
|
show_uevalid=sco_preferences.get_preference(
|
||||||
"bul_show_uevalid", formsemestre_id
|
"bul_show_uevalid", formsemestre_id
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
d["situation"] = scu.quote_xml_attr(infos["situation"])
|
d["situation"] = infos["situation"]
|
||||||
if dpv:
|
if dpv:
|
||||||
decision = dpv["decisions"][0]
|
decision = dpv["decisions"][0]
|
||||||
etat = decision["etat"]
|
etat = decision["etat"]
|
||||||
@ -355,7 +380,13 @@ def formsemestre_bulletinetud_published_dict(
|
|||||||
else:
|
else:
|
||||||
code = ""
|
code = ""
|
||||||
|
|
||||||
d["decision"] = dict(code=code, etat=etat)
|
d["decision"] = dict(
|
||||||
|
code=code,
|
||||||
|
etat=etat,
|
||||||
|
date=ndb.DateDMYtoISO(
|
||||||
|
dpv["decisions"][0]["decision_sem"]["event_date"]
|
||||||
|
),
|
||||||
|
)
|
||||||
if (
|
if (
|
||||||
decision["decision_sem"]
|
decision["decision_sem"]
|
||||||
and "compense_formsemestre_id" in decision["decision_sem"]
|
and "compense_formsemestre_id" in decision["decision_sem"]
|
||||||
@ -373,11 +404,11 @@ def formsemestre_bulletinetud_published_dict(
|
|||||||
d["decision_ue"].append(
|
d["decision_ue"].append(
|
||||||
dict(
|
dict(
|
||||||
ue_id=ue["ue_id"],
|
ue_id=ue["ue_id"],
|
||||||
numero=scu.quote_xml_attr(ue["numero"]),
|
numero=ue["numero"],
|
||||||
acronyme=scu.quote_xml_attr(ue["acronyme"]),
|
acronyme=ue["acronyme"],
|
||||||
titre=scu.quote_xml_attr(ue["titre"]),
|
titre=ue["titre"],
|
||||||
code=decision["decisions_ue"][ue_id]["code"],
|
code=decision["decisions_ue"][ue_id]["code"],
|
||||||
ects=scu.quote_xml_attr(ue["ects"] or ""),
|
ects=ue["ects"] or "",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
d["autorisation_inscription"] = []
|
d["autorisation_inscription"] = []
|
||||||
@ -387,20 +418,4 @@ def formsemestre_bulletinetud_published_dict(
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
d["decision"] = dict(code="", etat="DEM")
|
d["decision"] = dict(code="", etat="DEM")
|
||||||
|
|
||||||
# --- Appreciations
|
|
||||||
cnx = ndb.GetDBConnexion()
|
|
||||||
apprecs = sco_etud.appreciations_list(
|
|
||||||
cnx, args={"etudid": etudid, "formsemestre_id": formsemestre_id}
|
|
||||||
)
|
|
||||||
d["appreciation"] = []
|
|
||||||
for app in apprecs:
|
|
||||||
d["appreciation"].append(
|
|
||||||
dict(
|
|
||||||
comment=scu.quote_xml_attr(app["comment"]),
|
|
||||||
date=ndb.DateDMYtoISO(app["date"]),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
#
|
|
||||||
return d
|
return d
|
||||||
|
Loading…
Reference in New Issue
Block a user