diff --git a/objets.py b/objets.py index eea54ab..9d01651 100644 --- a/objets.py +++ b/objets.py @@ -1012,6 +1012,12 @@ class proprio(CransLdapObject): """Retourne la date de fin d'adhésion""" return max([float(facture.get('finAdhesion', [crans_utils.from_generalized_time_format(attributs.finAdhesion.default)])[0]) for facture in self.factures(refresh=True, mode="ro") if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != ''] + [0.0]) + def fin_connexion_datetime(self): + return datetime.datetime.fromtimestamp(self.fin_connexion()) + + def fin_adhesion_datetime(self): + return datetime.datetime.fromtimestamp(self.fin_adhesion()) + def fin_connexion(self): """Retourne la date de fin de connexion""" return max([float(facture.get('finConnexion', [crans_utils.from_generalized_time_format(attributs.finConnexion.default)])[0]) for facture in self.factures(refresh=True, mode="ro") if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != ''] + [0.0])