Don't error out here until we decide if we are going to fully refactor emums or leave as is.
This commit is contained in:
parent
00e0bd5dd2
commit
5706fb3ad3
|
@ -415,8 +415,8 @@ class WorkflowService(object):
|
||||||
if hasattr(default, "value"):
|
if hasattr(default, "value"):
|
||||||
default_option = next((obj for obj in field.options if obj.id == default.value), None)
|
default_option = next((obj for obj in field.options if obj.id == default.value), None)
|
||||||
else:
|
else:
|
||||||
raise ApiError.from_task("invalid_default", "A default for enums must be a dictionary with a"
|
# Fixme: We should likely error out on this in validation, or remove this value/label alltogether.
|
||||||
" value attribute.", task)
|
default_option = next((obj for obj in field.options if obj.id == default), None)
|
||||||
if not default_option:
|
if not default_option:
|
||||||
raise ApiError.from_task("invalid_default", "You specified a default value that does not exist in "
|
raise ApiError.from_task("invalid_default", "You specified a default value that does not exist in "
|
||||||
"the enum options ", task)
|
"the enum options ", task)
|
||||||
|
|
Loading…
Reference in New Issue