From 1b34edfda6596408d6e97ee4062249caca46ec09 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Tue, 27 Dec 2022 20:22:00 +0100 Subject: [PATCH] fixes --- app/orm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/orm.py b/app/orm.py index 7982b84..31fa64c 100644 --- a/app/orm.py +++ b/app/orm.py @@ -40,7 +40,7 @@ class Origin(Base): os_platform=origin.os_platform, os_version=origin.os_version, ) - session.execute(update(Origin).where(Origin.origin_ref == origin.origin_ref).values(values)) + session.execute(update(Origin).where(Origin.origin_ref == origin.origin_ref).values(**values)) session.flush() session.close() @@ -73,7 +73,7 @@ class Lease(Base): session.add(lease) else: values = dict(lease_expires=lease.lease_expires, lease_updated=lease.lease_updated) - session.execute(update(Lease).where(and_(Lease.origin_ref == lease.origin_ref, Lease.lease_ref == lease.lease_ref)).values(values)) + session.execute(update(Lease).where(and_(Lease.origin_ref == lease.origin_ref, Lease.lease_ref == lease.lease_ref)).values(**values)) session.flush() session.close() @@ -95,7 +95,7 @@ class Lease(Base): def renew(engine: Engine, lease: "Lease", lease_expires: datetime.datetime, lease_updated: datetime.datetime): session = sessionmaker(autocommit=True, autoflush=True, bind=engine)() values = dict(lease_expires=lease.lease_expires, lease_updated=lease.lease_updated) - session.execute(update(Lease).where(and_(Lease.origin_ref == lease.origin_ref, Lease.lease_ref == lease.lease_ref)).values(values)) + session.execute(update(Lease).where(and_(Lease.origin_ref == lease.origin_ref, Lease.lease_ref == lease.lease_ref)).values(**values)) session.close() @staticmethod