diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index aa69bc5d..1cb123f2 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -2180,7 +2180,7 @@ class Adherent(BaseProprietaire): écoulées depuis Epoch. Si new est donné, met à jour la valeur si elle est plus récente. """ - + # si l'adhérent n'a pas de compte, on lève une exception if not self.compte(): raise NotImplementedError, u"L'adhérent n'a pas de compte" @@ -2195,8 +2195,15 @@ class Adherent(BaseProprietaire): current = new return current - - + + 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)) + + class Club(BaseProprietaire): """ Classe de définition d'un club """ idn = 'cid' diff --git a/gestion/whos.py b/gestion/whos.py index 01dd3d93..4919fd1e 100755 --- a/gestion/whos.py +++ b/gestion/whos.py @@ -367,10 +367,12 @@ def adher_details(adher) : else: f += coul(strftime('%d/%m/%Y %H:%M', localtime(timestamp)), time()-timestamp > 32*24*3600 and 'rouge' or '') - f += u'\n' + f += u"\n" # État administratif - f += coul(u'État administratif : ','gras') + f += coul("Date d'inscription : ", "gras") + f += strftime('%d/%m/%Y %H:%M', localtime(adher.dateInscription())) + f += coul(u'\nÉtat administratif : ','gras') jour=1 if ann_scol not in adher.carteEtudiant() : f += coul(u"manque carte d'étudiant",'violet')