From b6d3917ef7857806b12d430ecadd28de5ffd2fd3 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Sun, 26 Oct 2014 17:19:52 +0100 Subject: [PATCH] mail_module: joli name pour un adh --- gestion/mail/mail.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gestion/mail/mail.py b/gestion/mail/mail.py index d52da2cd..e01f1805 100644 --- a/gestion/mail/mail.py +++ b/gestion/mail/mail.py @@ -36,7 +36,13 @@ def format_date(d): else: return d.strftime('%A, %B %d %Y') +def given_name(adh): + if 'club' in adh['objectClass']: + return u'Club %s' % unicode(adh['nom'][0]) + return unicode(adh['prenom'][0]) + " " + unicode(adh['nom'][0]) + templateEnv.filters['date'] = format_date +templateEnv.filters['name'] = given_name # file extension to rendering function map