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:
parent
af26da7b64
commit
10199f896b
1 changed files with 2 additions and 2 deletions
|
|
@ -105,7 +105,7 @@ def create_job(req: JobSubmissionRequest) -> JobStatusResponse:
|
|||
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:
|
||||
"""Get current status of a conversion job."""
|
||||
try:
|
||||
|
|
@ -114,7 +114,7 @@ def job_status(job_id: str) -> JobStatusResponse:
|
|||
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:
|
||||
"""Delete or preserve staging files for a job."""
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue