From 2710ca72719b9b90c798bbc066b40682098290bd Mon Sep 17 00:00:00 2001 From: ljf Date: Mon, 13 Sep 2021 00:25:55 +0200 Subject: [PATCH] [fix] Missing default property --- locales/en.json | 2 ++ src/yunohost/utils/config.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/locales/en.json b/locales/en.json index eb131fe43..fe340fff2 100644 --- a/locales/en.json +++ b/locales/en.json @@ -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", diff --git a/src/yunohost/utils/config.py b/src/yunohost/utils/config.py index 270503f8f..e0b893356 100644 --- a/src/yunohost/utils/config.py +++ b/src/yunohost/utils/config.py @@ -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), )