From 50c15ab2c1dac13702b83def8f12840a169dc594 Mon Sep 17 00:00:00 2001 From: glondu Date: Mon, 25 Sep 2006 21:15:13 +0200 Subject: [PATCH] Oubli stupide. darcs-hash:20060925191513-68412-2d441525e812c640b841282da79944de32a81f96.gz --- gestion/ldap_crans.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 1cb123f2..ef80f663 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -2199,9 +2199,14 @@ class Adherent(BaseProprietaire): def dateInscription(self): """Renvoie la date d'inscription.""" # En théorie, c'est la date de la première entrée dans l'historique - h = self.historique()[0] - h = h[:h.find(",")] - return time.mktime(time.strptime(h, date_format)) + if self.historique(): + h = self.historique()[0] + h = h[:h.find(",")] + return time.mktime(time.strptime(h, date_format)) + else: + # Lors de l'inscription d'un nouvel adhérent, celui-ci n'a pas + # encore d'historique. On retourne alors la date en cours. + return time.time() class Club(BaseProprietaire):