fix review comments

This commit is contained in:
Georges-Antoine Assi
2025-08-02 12:53:16 -04:00
parent 036a66a9df
commit d8af2f8956
2 changed files with 3 additions and 3 deletions

View File

@@ -125,14 +125,14 @@ async def run_single_task(request: Request, task_name: str) -> MessageResponse:
available_tasks = list(all_tasks.keys())
raise HTTPException(
status_code=404,
detail=f"Task '{task_name}' not found. Available tasks: {', '.join(available_tasks)}",
detail=f"Task '{task_name}' not found, available tasks are {', '.join(available_tasks)}",
)
task_instance = all_tasks[task_name]
if not task_instance.enabled or not task_instance.manual_run:
raise HTTPException(
status_code=400,
detail=f"Task '{task_name}' is cannot be run",
detail=f"Task '{task_name}' cannot be run",
)
low_prio_queue.enqueue(task_instance.run)

View File

@@ -293,7 +293,7 @@ class TestRunSingleTask:
assert response.status_code == 404
data = response.json()
assert "not found" in data["detail"].lower()
assert "Available tasks:" in data["detail"]
assert "available tasks are" in data["detail"]
@patch("endpoints.tasks.low_prio_queue")
@patch(