This commit is contained in:
Oscar Krause 2022-12-27 20:28:09 +01:00
parent 1b34edfda6
commit c38ed25a2f
1 changed files with 1 additions and 1 deletions

View File

@ -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