@cryptotaxi247 / CoPilot / commits / 1558bc90

Velo identify fix (#425)

* fix: log connector name usage and update connector ID access method in YAML upload * precommit fixes

taylor_socfortress committed Mar 14, 2025 at 15:33 UTC 1558bc90f28209701c706bc751610ea590235b2b
2 files changed +6 -2
backend/app/connectors/routes.py
+6 -1
@@ -234,6 +234,7 @@ async def update_connector(
234 # logger.error(f"Failed to upload file: {e}")
235 # raise HTTPException(status_code=500, detail="Failed to upload file")
236
237 +
238 @connector_router.post(
239 "/upload/{connector_identifier}",
240 description="Upload a YAML file for a specific connector",
@@ -273,6 +274,7 @@ async def upload_yaml_file(
274 except ValueError:
275 # If not an integer, treat as connector name
276 connector_name = connector_identifier
277 + logger.info(f"Using connector name: {connector_name}")
278 try:
279 # Look up the connector ID from the name
280 connector = await ConnectorServices.fetch_connector_by_name(connector_name, session=session)
@@ -281,7 +283,10 @@ async def upload_yaml_file(
283 status_code=404,
284 detail=f"No connector found with name: {connector_name}",
285 )
284 - connector_id = connector["id"]
286 +
287 + # Access as an attribute using dot notation, not as a dictionary
288 + connector_id = connector.id
289 +
290 # Check if this is a valid connector for YAML uploads
291 if connector_id not in [5, 6]:
292 raise HTTPException(
backend/app/connectors/services.py
-1
@@ -469,4 +469,3 @@ class ConnectorServices:
469 return False
470 else:
471 return False
472 -