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:
Dan 2021-10-12 14:32:51 -04:00
parent 00e0bd5dd2
commit 5706fb3ad3
1 changed files with 2 additions and 2 deletions

View File

@ -415,8 +415,8 @@ class WorkflowService(object):
if hasattr(default, "value"):
default_option = next((obj for obj in field.options if obj.id == default.value), None)
else:
raise ApiError.from_task("invalid_default", "A default for enums must be a dictionary with a"
" value attribute.", task)
# Fixme: We should likely error out on this in validation, or remove this value/label alltogether.
default_option = next((obj for obj in field.options if obj.id == default), None)
if not default_option:
raise ApiError.from_task("invalid_default", "You specified a default value that does not exist in "
"the enum options ", task)