Fix etud_info xml/json quote

This commit is contained in:
Emmanuel Viennet 2021-10-20 23:18:00 +02:00
parent 280f6cf1c1
commit 0f67ee33ae

View File

@ -415,12 +415,10 @@ def etud_info(etudid=None, format="xml"):
"codelycee", "codelycee",
"date_naissance_iso", "date_naissance_iso",
): ):
d[a] = scu.quote_xml_attr(etud[a]) d[a] = etud[a] # ne pas quoter car ElementTree.tostring quote déjà
d["civilite"] = scu.quote_xml_attr( d["civilite"] = etud["civilite_str"] # exception: ne sort pas la civilite brute
etud["civilite_str"]
) # exception: ne sort pas la civilite brute
d["sexe"] = d["civilite"] # backward compat pour anciens clients d["sexe"] = d["civilite"] # backward compat pour anciens clients
d["photo_url"] = scu.quote_xml_attr(sco_photos.etud_photo_url(etud)) d["photo_url"] = sco_photos.etud_photo_url(etud)
sem = etud["cursem"] sem = etud["cursem"]
if sem: if sem:
@ -431,10 +429,8 @@ def etud_info(etudid=None, format="xml"):
"formsemestre_id": sem["formsemestre_id"], "formsemestre_id": sem["formsemestre_id"],
"date_debut": ndb.DateDMYtoISO(sem["date_debut"]), "date_debut": ndb.DateDMYtoISO(sem["date_debut"]),
"date_fin": ndb.DateDMYtoISO(sem["date_fin"]), "date_fin": ndb.DateDMYtoISO(sem["date_fin"]),
"etat": scu.quote_xml_attr(sem["ins"]["etat"]), "etat": sem["ins"]["etat"],
"groupes": scu.quote_xml_attr( "groupes": etud["groupes"], # slt pour semestre courant
etud["groupes"]
), # slt pour semestre courant
} }
] ]
else: else:
@ -446,7 +442,7 @@ def etud_info(etudid=None, format="xml"):
"formsemestre_id": sem["formsemestre_id"], "formsemestre_id": sem["formsemestre_id"],
"date_debut": ndb.DateDMYtoISO(sem["date_debut"]), "date_debut": ndb.DateDMYtoISO(sem["date_debut"]),
"date_fin": ndb.DateDMYtoISO(sem["date_fin"]), "date_fin": ndb.DateDMYtoISO(sem["date_fin"]),
"etat": scu.quote_xml_attr(sem["ins"]["etat"]), "etat": sem["ins"]["etat"],
} }
) )