main.py - migrated merged changes from dataset to sqlalchemy

This commit is contained in:
Oscar Krause 2022-12-27 19:05:41 +01:00
parent c7aa28382a
commit b5c64038cb

View File

@ -197,14 +197,14 @@ async def auth_v1_origin_update(request: Request):
origin_ref = j['origin_ref'] origin_ref = j['origin_ref']
logging.info(f'> [ update ]: {origin_ref}: {j}') logging.info(f'> [ update ]: {origin_ref}: {j}')
data = dict( data = Origin(
origin_ref=origin_ref, origin_ref=origin_ref,
hostname=j['environment']['hostname'], hostname=j['environment']['hostname'],
guest_driver_version=j['environment']['guest_driver_version'], guest_driver_version=j['environment']['guest_driver_version'],
os_platform=j['environment']['os_platform'], os_version=j['environment']['os_version'], os_platform=j['environment']['os_platform'], os_version=j['environment']['os_version'],
) )
db['origin'].upsert(data, ['origin_ref']) Origin.create_or_update(db, data)
response = { response = {
"environment": j['environment'], "environment": j['environment'],