mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 12:13:33 +08:00
Merge pull request #11778 from jmchilton/pydantic_18
Fix workflow refactor schema parsing for pydantic 1.8.
This commit is contained in:
@@ -241,7 +241,14 @@ union_action_classes = Union[
|
||||
|
||||
ACTION_CLASSES_BY_TYPE = {}
|
||||
for action_class in union_action_classes.__args__: # type: ignore
|
||||
action_type = action_class.schema()["properties"]["action_type"]["const"]
|
||||
action_type_def = action_class.schema()["properties"]["action_type"]
|
||||
try:
|
||||
# pydantic 1.8
|
||||
action_type = action_type_def["enum"][0]
|
||||
except KeyError:
|
||||
# pydantic 1.7
|
||||
action_type = action_type_def["const"]
|
||||
|
||||
ACTION_CLASSES_BY_TYPE[action_type] = action_class
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user