mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2024-11-21 22:08:48 +00:00
orm.py - fixed renewing timestamps from params
This commit is contained in:
parent
e0843ca1d4
commit
569ca8b3ea
@ -125,7 +125,7 @@ class Lease(Base):
|
||||
@staticmethod
|
||||
def renew(engine: Engine, lease: "Lease", lease_expires: datetime.datetime, lease_updated: datetime.datetime):
|
||||
session = sessionmaker(bind=engine)()
|
||||
x = dict(lease_expires=lease.lease_expires, lease_updated=lease.lease_updated)
|
||||
x = dict(lease_expires=lease_expires, lease_updated=lease_updated)
|
||||
session.execute(update(Lease).where(and_(Lease.origin_ref == lease.origin_ref, Lease.lease_ref == lease.lease_ref)).values(**x))
|
||||
session.commit()
|
||||
session.close()
|
||||
|
Loading…
Reference in New Issue
Block a user