fix bul json si ects None

This commit is contained in:
Emmanuel Viennet 2021-08-30 16:43:18 +02:00
parent d79da28aba
commit f672c17bbf

View File

@ -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"]),