From f672c17bbfea6987615af1ef20ae194fe4f9dfcf Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 30 Aug 2021 16:43:18 +0200 Subject: [PATCH] fix bul json si ects None --- app/scodoc/sco_bulletins_json.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scodoc/sco_bulletins_json.py b/app/scodoc/sco_bulletins_json.py index 5acfb599..93e45e3c 100644 --- a/app/scodoc/sco_bulletins_json.py +++ b/app/scodoc/sco_bulletins_json.py @@ -189,10 +189,10 @@ def formsemestre_bulletinetud_published_dict( d["ue_capitalisee"] = [] for ue in ues: ue_status = nt.get_etud_ue_status(etudid, ue["ue_id"]) - try: - ects_txt = str(int(ue["ects"])) - except ValueError: + if ue["ects"] is None: ects_txt = "" + else: + ects_txt = f"{ue['ects']:2.3g}" u = dict( id=ue["ue_id"], numero=scu.quote_xml_attr(ue["numero"]),