From 9610cc6b0bf9b0f771a17b7c9b697b232399bbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Sat, 26 Sep 2015 00:54:42 +0200 Subject: [PATCH] Le nouveau type de recuPaiement n'est pas compatible avec != '' --- objets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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,