diff --git a/objets.py b/objets.py index 17fcbbf..175c730 100644 --- a/objets.py +++ b/objets.py @@ -1040,7 +1040,7 @@ class proprio(CransLdapObject): return max([ float(facture.get('finAdhesion', [crans_utils.from_generalized_time_format(attributs.finAdhesion.default)])[0]) for facture in self.factures(refresh=(time.time() - self._factures_last_update > FACTURES_REFRESH_PERIOD)) - if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != '' + if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', []) ] + [0.0]) def fin_connexion_datetime(self): @@ -1054,7 +1054,7 @@ class proprio(CransLdapObject): return max([ float(facture.get('finConnexion', [crans_utils.from_generalized_time_format(attributs.finConnexion.default)])[0]) for facture in self.factures(refresh=(time.time() - self._factures_last_update > FACTURES_REFRESH_PERIOD)) - if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != '' + if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', []) ] + [0.0]) def adhesion_ok(self, no_bl=False): @@ -1698,7 +1698,7 @@ class facture(CransLdapObject): with self.proprio() as proprio: proprio_save = credite_arts(proprio) # On vient de créditer, le paiement a été reçu - self['recuPaiement'] = unicode(time.strftime("%Y-%m-%d %H:%M:%S")) + self['recuPaiement'] = crans_utils.localized_datetime() self._recuPaiement = True # Il faudrait faire quelquechose pour que si l'enregistrement suivant de la facture crash,