Fix toolbox.get_tool return type annotation

This commit is contained in:
mvdbeek
2025-05-12 10:54:45 +02:00
parent ef409b27c2
commit 4ae1ea2010
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -832,7 +832,10 @@ class AbstractToolBox(ManagesIntegratedToolPanelMixin):
self.get_tool(tool_id, tool_version=tool_version, tool_uuid=tool_uuid, exact=exact, user=user) is not None
)
def get_unprivileged_tool(self, user: model.User, tool_uuid: Union[UUID, str]) -> Optional["Tool"]:
def get_unprivileged_tool(self, user: "User", tool_uuid: Union[UUID, str]) -> Optional["Tool"]:
return None
def get_unprivileged_tool_or_none(self, user: "User", tool_uuid: Union[UUID, str]) -> Optional["Tool"]:
return None
def is_missing_shed_tool(self, tool_id: str) -> bool:
@@ -123,6 +123,7 @@ class ToolsService(ServiceBase):
if tool_id is None and tool_uuid is None:
raise exceptions.RequestParameterMissingException("Must specify either a tool_id or a tool_uuid.")
tool: Optional[Tool] = None
if tool_uuid:
tool = trans.app.toolbox.get_unprivileged_tool(trans.user, tool_uuid=tool_uuid)
if not tool: