mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
configpanels/forms : more edge cases with some questions not implementing some methods/attributes
This commit is contained in:
parent
07daa68770
commit
b0fe49ae83
1 changed files with 8 additions and 4 deletions
|
@ -160,11 +160,15 @@ class ConfigPanel:
|
|||
result[key] = {"ask": ask}
|
||||
if "current_value" in option:
|
||||
question_class = OPTIONS[option.get("type", OptionType.string)]
|
||||
result[key]["value"] = question_class.humanize(
|
||||
option["current_value"], option
|
||||
)
|
||||
if hasattr(question_class, "humanize"):
|
||||
result[key]["value"] = question_class.humanize(
|
||||
option["current_value"], option
|
||||
)
|
||||
else:
|
||||
result[key]["value"] = option["current_value"]
|
||||
|
||||
# FIXME: semantics, technically here this is not about a prompt...
|
||||
if question_class.hide_user_input_in_prompt:
|
||||
if getattr(question_class, "hide_user_input_in_prompt", None):
|
||||
result[key][
|
||||
"value"
|
||||
] = "**************" # Prevent displaying password in `config get`
|
||||
|
|
Loading…
Add table
Reference in a new issue