Quelques trucs qui traînent.
This commit is contained in:
parent
d0619adcf6
commit
607a691a88
2 changed files with 4 additions and 4 deletions
|
@ -1855,12 +1855,12 @@ class certificat(Attr):
|
||||||
if certificat.startswith('-----BEGIN CERTIFICATE-----'):
|
if certificat.startswith('-----BEGIN CERTIFICATE-----'):
|
||||||
certificat = ssl.PEM_cert_to_DER_cert(certificat)
|
certificat = ssl.PEM_cert_to_DER_cert(certificat)
|
||||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, certificat)
|
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, certificat)
|
||||||
except Exception:
|
except Exception as e1:
|
||||||
try:
|
try:
|
||||||
certificat = base64.b64decode(certificat)
|
certificat = base64.b64decode(certificat)
|
||||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, certificat)
|
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, certificat)
|
||||||
except Exception:
|
except Exception as e2:
|
||||||
raise ValueError("Format du certificat invalide, est-il bien au format DER ou PEM ?")
|
raise ValueError("Format du certificat invalide, est-il bien au format DER ou PEM ? :\nerreur1 : %r, erreur2 : %r" % (e1, e2))
|
||||||
data = fetch_cert_info(x509)
|
data = fetch_cert_info(x509)
|
||||||
return (certificat, data)
|
return (certificat, data)
|
||||||
|
|
||||||
|
|
|
@ -1568,7 +1568,7 @@ class facture(CransLdapObject):
|
||||||
with self.proprio() as proprio:
|
with self.proprio() as proprio:
|
||||||
proprio_save = credite_arts(proprio)
|
proprio_save = credite_arts(proprio)
|
||||||
# On vient de créditer, le paiement a été reçu
|
# On vient de créditer, le paiement a été reçu
|
||||||
self['recuPaiement']=unicode(int(time.time()))
|
self['recuPaiement']=unicode(time.strftime("%Y-%m-%d %H:%M:%S"))
|
||||||
self._recuPaiement = True
|
self._recuPaiement = True
|
||||||
|
|
||||||
# Il faudrait faire quelquechose pour que si l'enregistrement suivant de la facture crash,
|
# Il faudrait faire quelquechose pour que si l'enregistrement suivant de la facture crash,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue