mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #17985 from mvdbeek/invalid_datatype_message_fix
[24.0] Raise MessagException if collection element has unknown extension
This commit is contained in:
@@ -17,8 +17,12 @@ from typing import (
|
||||
from packaging.version import Version
|
||||
|
||||
from galaxy import model
|
||||
from galaxy.exceptions import ItemAccessibilityException
|
||||
from galaxy.exceptions import (
|
||||
ItemAccessibilityException,
|
||||
RequestParameterInvalidException,
|
||||
)
|
||||
from galaxy.job_execution.actions.post import ActionBox
|
||||
from galaxy.managers.context import ProvidesHistoryContext
|
||||
from galaxy.model import (
|
||||
HistoryDatasetAssociation,
|
||||
Job,
|
||||
@@ -98,7 +102,7 @@ class DefaultToolAction(ToolAction):
|
||||
self,
|
||||
tool,
|
||||
param_values,
|
||||
trans,
|
||||
trans: ProvidesHistoryContext,
|
||||
history,
|
||||
current_user_roles=None,
|
||||
dataset_collection_elements=None,
|
||||
@@ -256,6 +260,10 @@ class DefaultToolAction(ToolAction):
|
||||
for ext in extensions:
|
||||
if ext:
|
||||
datatype = trans.app.datatypes_registry.get_datatype_by_extension(ext)
|
||||
if not datatype:
|
||||
raise RequestParameterInvalidException(
|
||||
f"Extension '{ext}' unknown, cannot use dataset collection as input"
|
||||
)
|
||||
if not datatype.matches_any(input.formats):
|
||||
conversion_required = True
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user