From c38ed25a2fa22573dc0728a8d8682717be310ba6 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Tue, 27 Dec 2022 20:28:09 +0100 Subject: [PATCH] fixes --- app/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/orm.py b/app/orm.py index 31fa64c..26b869a 100644 --- a/app/orm.py +++ b/app/orm.py @@ -101,7 +101,7 @@ class Lease(Base): @staticmethod def cleanup(engine: Engine, origin_ref: str) -> int: session = sessionmaker(autocommit=True, autoflush=True, bind=engine)() - deletions = session.query(Lease).delete(Lease.origin_ref == origin_ref) + deletions = session.query(Lease).filter(Lease.origin_ref == origin_ref).delete() session.close() return deletions