fix: escape f-string braces in backend route decorators

{job_id} in f-strings was interpreted as Python variable instead
of FastAPI path parameter. Double braces {{job_id}} produce
literal {job_id} in the route string.
This commit is contained in:
Claus Lohmar 2026-07-21 18:17:41 +00:00
parent af26da7b64
commit 10199f896b

View file

@ -105,7 +105,7 @@ def create_job(req: JobSubmissionRequest) -> JobStatusResponse:
raise HTTPException(status_code=400, detail=str(exc)) raise HTTPException(status_code=400, detail=str(exc))
@app.get(f"{API_PREFIX}/jobs/{job_id}", response_model=JobStatusResponse) @app.get(f"{API_PREFIX}/jobs/{{job_id}}", response_model=JobStatusResponse)
def job_status(job_id: str) -> JobStatusResponse: def job_status(job_id: str) -> JobStatusResponse:
"""Get current status of a conversion job.""" """Get current status of a conversion job."""
try: try:
@ -114,7 +114,7 @@ def job_status(job_id: str) -> JobStatusResponse:
raise HTTPException(status_code=404, detail=f"Job not found: {job_id}") raise HTTPException(status_code=404, detail=f"Job not found: {job_id}")
@app.post(f"{API_PREFIX}/jobs/{job_id}/cleanup", response_model=CleanupResponse) @app.post(f"{API_PREFIX}/jobs/{{job_id}}/cleanup", response_model=CleanupResponse)
def cleanup_job(job_id: str, req: CleanupRequest) -> CleanupResponse: def cleanup_job(job_id: str, req: CleanupRequest) -> CleanupResponse:
"""Delete or preserve staging files for a job.""" """Delete or preserve staging files for a job."""
try: try: