chore: fix all ruff lint errors + format — 0 errors, 306 tests pass
This commit is contained in:
@@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
import uuid
|
||||
|
||||
from fastapi import APIRouter, Body, Depends, HTTPException, Response, status
|
||||
from sqlalchemy import select, delete
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.core.db import get_db
|
||||
@@ -24,7 +24,9 @@ def _parse_uuid(val: str, field: str) -> uuid.UUID:
|
||||
try:
|
||||
return uuid.UUID(val)
|
||||
except (ValueError, TypeError):
|
||||
raise HTTPException(400, detail={"detail": f"Invalid {field}", "code": "invalid_id"})
|
||||
raise HTTPException(
|
||||
400, detail={"detail": f"Invalid {field}", "code": "invalid_id"}
|
||||
) from None
|
||||
|
||||
|
||||
@router.post("/files/{file_id}/link")
|
||||
@@ -41,7 +43,9 @@ async def link_file_to_entity(
|
||||
entity_id = _parse_uuid(body.entity_id, "entity_id")
|
||||
|
||||
if body.entity_type not in VALID_ENTITY_TYPES:
|
||||
raise HTTPException(400, detail={"detail": "Invalid entity_type", "code": "invalid_entity_type"})
|
||||
raise HTTPException(
|
||||
400, detail={"detail": "Invalid entity_type", "code": "invalid_entity_type"}
|
||||
)
|
||||
|
||||
# Check if link already exists
|
||||
existing = await db.execute(
|
||||
|
||||
Reference in New Issue
Block a user