support empty choice

This commit is contained in:
2020-03-16 15:34:51 +01:00
parent 1bcfa0618a
commit 505af25995
2 changed files with 209 additions and 2 deletions

View File

@ -26,7 +26,7 @@ except ImportError:
RequirementError = PropertiesOptionError
LeadershipError = ValueError
try:
from tiramisu__api import Config as ConfigJson
from tiramisu_api import Config as ConfigJson
if Config is None:
Config = ConfigJson
except ImportError:
@ -39,7 +39,7 @@ def get_choice_list(obj, properties, display):
return str(choice)
return choice
choices = [convert(choice) for choice in obj.value.list()]
if choices[0] == '':
if choices and choices[0] == '':
del choices[0]
if display:
choices = '{{{}}}'.format(','.join(choices))