forked from ScoDoc/ScoDoc
Fix: codage chaine interrogation portail
This commit is contained in:
parent
2b967ba34e
commit
97446272af
@ -292,7 +292,7 @@ def suppress_photo(context, etud, REQUEST=None):
|
||||
|
||||
|
||||
def save_image(context, etudid, data):
|
||||
"""img_file is a file-like object.
|
||||
"""data is a bytes string.
|
||||
Save image in JPEG in 2 sizes (original and h90).
|
||||
Returns filename (relative to PHOTO_DIR), without extension
|
||||
"""
|
||||
|
@ -267,20 +267,14 @@ def xml_to_list_of_dicts(doc, req=None):
|
||||
def get_infos_apogee_allaccents(context, nom, prenom):
|
||||
"essai recup infos avec differents codages des accents"
|
||||
if nom:
|
||||
unom = six.text_type(nom, scu.SCO_ENCODING)
|
||||
nom_noaccents = scu.suppress_accents(unom)
|
||||
nom_utf8 = unom.encode("utf-8")
|
||||
nom_noaccents = scu.suppress_accents(nom)
|
||||
else:
|
||||
nom_noaccents = nom
|
||||
nom_utf8 = nom
|
||||
|
||||
if prenom:
|
||||
uprenom = six.text_type(prenom, scu.SCO_ENCODING)
|
||||
prenom_noaccents = scu.suppress_accents(uprenom)
|
||||
prenom_utf8 = uprenom.encode("utf-8")
|
||||
prenom_noaccents = scu.suppress_accents(prenom)
|
||||
else:
|
||||
prenom_noaccents = prenom
|
||||
prenom_utf8 = prenom
|
||||
|
||||
# avec accents
|
||||
infos = query_apogee_portal(context, nom=nom, prenom=prenom)
|
||||
@ -289,9 +283,6 @@ def get_infos_apogee_allaccents(context, nom, prenom):
|
||||
infos += query_apogee_portal(
|
||||
context, nom=nom_noaccents, prenom=prenom_noaccents
|
||||
)
|
||||
# avec accents en UTF-8
|
||||
if nom_utf8 != nom_noaccents or prenom_utf8 != prenom_noaccents:
|
||||
infos += query_apogee_portal(context, nom=nom_utf8, prenom=prenom_utf8)
|
||||
return infos
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user