Fix: bug "rennes" sur les formsemestres sans formation associée

This commit is contained in:
Emmanuel Viennet 2022-06-23 17:53:27 +02:00
parent 5dc20aece0
commit 6f842dc877

View File

@ -158,9 +158,24 @@ def formsemestre_bulletinetud_dict(formsemestre_id, etudid, version="long"):
I["server_name"] = request.url_root
# Formation et parcours
if I["sem"]["formation_id"]:
I["formation"] = sco_formations.formation_list(
args={"formation_id": I["sem"]["formation_id"]}
)[0]
else: # what's the fuck ?
I["formation"] = {
"acronyme": "?",
"code_specialite": "",
"dept_id": 1,
"formation_code": "?",
"formation_id": -1,
"id": -1,
"referentiel_competence_id": None,
"titre": "?",
"titre_officiel": "?",
"type_parcours": 0,
"version": 0,
}
I["parcours"] = sco_codes_parcours.get_parcours_from_code(
I["formation"]["type_parcours"]
)