Autocommit is off by default, even for read operations

This commit is contained in:
Benjamin Collet 2025-03-24 13:18:48 +01:00
parent d78d2ff83c
commit 76f05e98b6
Signed by: bcollet
SSH key fingerprint: SHA256:8UJspOIcCOS+MtSOcnuq2HjKFube4ox1s/+A62ixov4
2 changed files with 4 additions and 0 deletions
step-ca-inspector/models

View file

@ -23,6 +23,7 @@ class list:
cls.certs.append(cert_object)
cur.close()
db.commit()
if sort_key is not None:
cls.certs.sort(key=lambda item: getattr(item, sort_key))
@ -113,6 +114,7 @@ class cert:
cert = None
cur.close()
db.commit()
return cert
def get_public_key_params(self, public_key):

View file

@ -25,6 +25,7 @@ class list:
cls.certs.append(cert_object)
cur.close()
db.commit()
if sort_key is not None:
cls.certs.sort(key=lambda item: getattr(item, sort_key))
@ -121,6 +122,7 @@ class cert:
cert = None
cur.close()
db.commit()
return cert
def get_sans(self, san_data):