mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2024-12-28 08:34:04 +00:00
fixes
This commit is contained in:
parent
12bfd4c82a
commit
1b34edfda6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user