Fix db.get_asset_by_name -> db.get_asset

The function is named get_asset(), not get_asset_by_name().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-10 12:27:05 +00:00
parent 292f7bf316
commit 59484936fd

View File

@@ -1889,7 +1889,7 @@ async def _register_asset_impl(req: RegisterRequest, owner: str):
raise HTTPException(400, "IPFS CID is required for registration")
# Check if name exists - return existing asset if so
existing = await db.get_asset_by_name(req.name)
existing = await db.get_asset(req.name)
if existing:
logger.info(f"register_asset: Asset {req.name} already exists, returning existing")
return {"asset": existing, "activity": None, "existing": True}
@@ -1912,7 +1912,7 @@ async def _register_asset_impl(req: RegisterRequest, owner: str):
# Check name again inside transaction (race condition protection)
if await db.asset_exists_by_name_tx(conn, req.name):
# Race condition - another request created it first, return existing
existing = await db.get_asset_by_name(req.name)
existing = await db.get_asset(req.name)
logger.info(f"register_asset: Asset {req.name} created by concurrent request")
return {"asset": existing, "activity": None, "existing": True}
@@ -2195,7 +2195,7 @@ async def record_run(req: RecordRunRequest, user: User = Depends(get_required_us
# Check if output already exists (by content_hash) - return existing if so
if await db.asset_exists_by_name_tx(conn, output_hash):
existing = await db.get_asset_by_name(output_hash)
existing = await db.get_asset(output_hash)
logger.info(f"record_run: Output {output_hash[:16]}... already exists")
return {"asset": existing, "activity": None, "existing": True}