mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2024-12-28 08:34:04 +00:00
orm.py - fixed not null column
This commit is contained in:
parent
b5c64038cb
commit
560b18b5c4
@ -68,6 +68,8 @@ class Lease(Base):
|
||||
session = sessionmaker(autocommit=True, autoflush=True, bind=engine)()
|
||||
entity = session.query(Lease).filter(and_(Lease.origin_ref == lease.origin_ref, Lease.lease_ref == lease.lease_ref)).first()
|
||||
if entity is None:
|
||||
if lease.lease_updated is None:
|
||||
lease.lease_updated = lease.lease_created
|
||||
session.add(lease)
|
||||
else:
|
||||
values = dict(lease_expires=lease.lease_expires, lease_updated=lease.lease_updated)
|
||||
|
Loading…
Reference in New Issue
Block a user