Skip to content

Commit

Permalink
Cast tool_uuid to string - if present in the payload - after validati…
Browse files Browse the repository at this point in the history
…on as uuid via the pydantic model, as it is expected to be of this type further down the line
  • Loading branch information
heisner-tillman committed Apr 12, 2024
1 parent 4be10f1 commit 5c63881
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/webapps/galaxy/services/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ def execute(
payload: ExecuteToolPayload,
) -> ExecuteToolResponse:
tool_id = payload.tool_id
tool_uuid = payload.tool_uuid
tool_uuid = str(payload.tool_uuid) if payload.tool_uuid else None
if tool_id in PROTECTED_TOOLS:
raise HTTPException(
status_code=400, detail=f"Cannot execute tool [{tool_id}] directly, must use alternative endpoint."
)
if tool_id is None and tool_uuid is None:
raise HTTPException(status_code=400, detail="Must specify a valid tool_id to use this endpoint.")
create_payload = payload.model_dump(exclude_unset=True)

create_payload["tool_uuid"] = tool_uuid
# process files, when they come in as multipart file data
files = {}
for key in list(create_payload.keys()):
Expand Down

0 comments on commit 5c63881

Please sign in to comment.