Skip to content

Commit a6bebd6

Browse files
committed
CSR/ORM: Lazy load using subqueries and clean after use
This should fix ORM session management
1 parent 3581663 commit a6bebd6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

caramel/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ class CSR(Base):
157157
order_by="Certificate.not_after.desc()",
158158
lazy="subquery",
159159
cascade="all, delete-orphan")
160-
x509_sans = _orm.relationship("SubjectAltName", backref="csr")
160+
x509_sans = _orm.relationship("SubjectAltName", backref="csr",
161+
lazy="subquery",
162+
cascade="all, delete-orphan")
161163

162164
def __init__(self, sha256sum, reqtext):
163165
# XXX: assert sha256(reqtext).hexdigest() == sha256sum ?

0 commit comments

Comments
 (0)