[fix] Missing default property

This commit is contained in:
ljf 2021-09-13 00:25:55 +02:00
parent ca5d7b32dc
commit 2710ca7271
2 changed files with 5 additions and 3 deletions

View file

@ -394,6 +394,8 @@
"hook_name_unknown": "Unknown hook name '{name}'",
"installation_complete": "Installation completed",
"invalid_number": "Must be a number",
"invalid_number_min": "Must be greater than {min}",
"invalid_number_max": "Must be lesser than {max}",
"invalid_password": "Invalid password",
"invalid_regex": "Invalid regex:'{regex}'",
"ip6tables_unavailable": "You cannot play with ip6tables here. You are either in a container or your kernel does not support it",

View file

@ -202,7 +202,7 @@ class ConfigPanel:
}
},
"options": {
"properties": ["ask", "type", "bind", "help", "example",
"properties": ["ask", "type", "bind", "help", "example", "default",
"style", "icon", "placeholder", "visible",
"optional", "choices", "yes", "no", "pattern",
"limit", "min", "max", "step", "accept", "redact"],
@ -787,14 +787,14 @@ class NumberQuestion(Question):
raise YunohostValidationError(
"app_argument_invalid",
name=self.name,
error=m18n.n("invalid_number"),
error=m18n.n("invalid_number_min", min=self.min),
)
if self.max is not None and int(self.value) > self.max:
raise YunohostValidationError(
"app_argument_invalid",
name=self.name,
error=m18n.n("invalid_number"),
error=m18n.n("invalid_number_max", max=self.max),
)