mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
configpanel: fix choices
This commit is contained in:
parent
c439c47d67
commit
fe2761da4a
1 changed files with 7 additions and 3 deletions
|
@ -30,6 +30,8 @@ from moulinette.utils.log import getActionLogger
|
||||||
from yunohost.utils.error import YunohostError, YunohostValidationError
|
from yunohost.utils.error import YunohostError, YunohostValidationError
|
||||||
from yunohost.utils.form import (
|
from yunohost.utils.form import (
|
||||||
OPTIONS,
|
OPTIONS,
|
||||||
|
BaseChoicesOption,
|
||||||
|
BaseInputOption,
|
||||||
BaseOption,
|
BaseOption,
|
||||||
FileOption,
|
FileOption,
|
||||||
ask_questions_and_parse_answers,
|
ask_questions_and_parse_answers,
|
||||||
|
@ -148,9 +150,11 @@ class ConfigPanel:
|
||||||
option["ask"] = ask
|
option["ask"] = ask
|
||||||
question_class = OPTIONS[option.get("type", "string")]
|
question_class = OPTIONS[option.get("type", "string")]
|
||||||
# FIXME : maybe other properties should be taken from the question, not just choices ?.
|
# FIXME : maybe other properties should be taken from the question, not just choices ?.
|
||||||
option["choices"] = question_class(option).choices
|
if issubclass(question_class, BaseChoicesOption):
|
||||||
option["default"] = question_class(option).default
|
option["choices"] = question_class(option).choices
|
||||||
option["pattern"] = question_class(option).pattern
|
if issubclass(question_class, BaseInputOption):
|
||||||
|
option["default"] = question_class(option).default
|
||||||
|
option["pattern"] = question_class(option).pattern
|
||||||
else:
|
else:
|
||||||
result[key] = {"ask": ask}
|
result[key] = {"ask": ask}
|
||||||
if "current_value" in option:
|
if "current_value" in option:
|
||||||
|
|
Loading…
Add table
Reference in a new issue