This commit is contained in:
Inex Code 2024-07-02 23:45:58 +04:00
parent 9cd8d75f73
commit 915d94179f

View file

@ -164,20 +164,20 @@ class Service:
# By the "type" field convert every dict into a ConfigItem. In the future there will be more types. # By the "type" field convert every dict into a ConfigItem. In the future there will be more types.
return [ return [
StringConfigItem( StringConfigItem(
id=item["id"], id=config_items[item]["id"],
description=item["description"], description=config_items[item]["description"],
widget=item["widget"], widget=config_items[item]["widget"],
type=item["type"], type=config_items[item]["type"],
value=item["value"], value=config_items[item]["value"],
regex=item.get("regex"), regex=config_items[item].get("regex"),
) )
if item["type"] == "string" if config_items[item]["type"] == "string"
else BoolConfigItem( else BoolConfigItem(
id=item["id"], id=config_items[item]["id"],
description=item["description"], description=config_items[item]["description"],
widget=item["widget"], widget=config_items[item]["widget"],
type=item["type"], type=config_items[item]["type"],
value=item["value"], value=config_items[item]["value"],
) )
for item in config_items for item in config_items
] ]