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",
"date_naissance_iso",
):
d[a] = scu.quote_xml_attr(etud[a])
d["civilite"] = scu.quote_xml_attr(
etud["civilite_str"]
) # exception: ne sort pas la civilite brute
d[a] = etud[a] # ne pas quoter car ElementTree.tostring quote déjà
d["civilite"] = etud["civilite_str"] # exception: ne sort pas la civilite brute
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"]
if sem:
@ -431,10 +429,8 @@ def etud_info(etudid=None, format="xml"):
"formsemestre_id": sem["formsemestre_id"],
"date_debut": ndb.DateDMYtoISO(sem["date_debut"]),
"date_fin": ndb.DateDMYtoISO(sem["date_fin"]),
"etat": scu.quote_xml_attr(sem["ins"]["etat"]),
"groupes": scu.quote_xml_attr(
etud["groupes"]
), # slt pour semestre courant
"etat": sem["ins"]["etat"],
"groupes": etud["groupes"], # slt pour semestre courant
}
]
else:
@ -446,7 +442,7 @@ def etud_info(etudid=None, format="xml"):
"formsemestre_id": sem["formsemestre_id"],
"date_debut": ndb.DateDMYtoISO(sem["date_debut"]),
"date_fin": ndb.DateDMYtoISO(sem["date_fin"]),
"etat": scu.quote_xml_attr(sem["ins"]["etat"]),
"etat": sem["ins"]["etat"],
}
)