From 6f842dc8777b5caa87c43bf8bb4ebe2f715ae5ce Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 23 Jun 2022 17:53:27 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20bug=20"rennes"=20sur=20les=20formsemestr?= =?UTF-8?q?es=20sans=20formation=20associ=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_bulletins.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/app/scodoc/sco_bulletins.py b/app/scodoc/sco_bulletins.py index df790649a..daf4a9419 100644 --- a/app/scodoc/sco_bulletins.py +++ b/app/scodoc/sco_bulletins.py @@ -158,9 +158,24 @@ def formsemestre_bulletinetud_dict(formsemestre_id, etudid, version="long"): I["server_name"] = request.url_root # Formation et parcours - I["formation"] = sco_formations.formation_list( - args={"formation_id": I["sem"]["formation_id"]} - )[0] + 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"] )