mail: strftime renvoie un str contenant accents
This commit is contained in:
parent
2b4d3b434e
commit
8928a950c7
1 changed files with 3 additions and 2 deletions
|
@ -35,10 +35,11 @@ templateLoader = jinja2.FileSystemLoader( searchpath=["/", template_path] )
|
||||||
templateEnv = jinja2.Environment( loader=templateLoader )
|
templateEnv = jinja2.Environment( loader=templateLoader )
|
||||||
|
|
||||||
def format_date(d):
|
def format_date(d):
|
||||||
|
# Beware: l'encodage utilisé ici dépend de la locale choisie plus bas
|
||||||
if 'fr_FR' in locale.getlocale():
|
if 'fr_FR' in locale.getlocale():
|
||||||
return d.strftime('%A %d %B %Y')
|
return d.strftime('%A %d %B %Y').decode('utf-8')
|
||||||
else:
|
else:
|
||||||
return d.strftime('%A, %B %d %Y')
|
return d.strftime('%A, %B %d %Y').decode('utf-8')
|
||||||
|
|
||||||
def given_name(adh):
|
def given_name(adh):
|
||||||
if 'club' in adh['objectClass']:
|
if 'club' in adh['objectClass']:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue