mail: strftime renvoie un str contenant accents

This commit is contained in:
Daniel STAN 2014-11-27 23:58:45 +01:00
parent 2b4d3b434e
commit 8928a950c7

View file

@ -35,10 +35,11 @@ templateLoader = jinja2.FileSystemLoader( searchpath=["/", template_path] )
templateEnv = jinja2.Environment( loader=templateLoader )
def format_date(d):
# Beware: l'encodage utilisé ici dépend de la locale choisie plus bas
if 'fr_FR' in locale.getlocale():
return d.strftime('%A %d %B %Y')
return d.strftime('%A %d %B %Y').decode('utf-8')
else:
return d.strftime('%A, %B %d %Y')
return d.strftime('%A, %B %d %Y').decode('utf-8')
def given_name(adh):
if 'club' in adh['objectClass']: