mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Fix error message for bad choice for setting enums
This commit is contained in:
parent
3f0632f337
commit
847cecaf7f
2 changed files with 3 additions and 3 deletions
|
@ -199,7 +199,7 @@
|
||||||
"firewall_reloaded": "The firewall has been reloaded",
|
"firewall_reloaded": "The firewall has been reloaded",
|
||||||
"firewall_rules_cmd_failed": "Some firewall rules commands have failed. For more information, see the log.",
|
"firewall_rules_cmd_failed": "Some firewall rules commands have failed. For more information, see the log.",
|
||||||
"format_datetime_short": "%m/%d/%Y %I:%M %p",
|
"format_datetime_short": "%m/%d/%Y %I:%M %p",
|
||||||
"global_settings_bad_choice_for_enum": "Bad value for setting {setting:s}, received {received_type:s}, except {expected_type:s}",
|
"global_settings_bad_choice_for_enum": "Bad choice for setting {setting:s}, received '{choice:s}' but available choices are : {available_choices:s}",
|
||||||
"global_settings_bad_type_for_setting": "Bad type for setting {setting:s}, received {received_type:s}, except {expected_type:s}",
|
"global_settings_bad_type_for_setting": "Bad type for setting {setting:s}, received {received_type:s}, except {expected_type:s}",
|
||||||
"global_settings_cant_open_settings": "Failed to open settings file, reason: {reason:s}",
|
"global_settings_cant_open_settings": "Failed to open settings file, reason: {reason:s}",
|
||||||
"global_settings_cant_serialize_settings": "Failed to serialize settings data, reason: {reason:s}",
|
"global_settings_cant_serialize_settings": "Failed to serialize settings data, reason: {reason:s}",
|
||||||
|
|
|
@ -109,8 +109,8 @@ def settings_set(key, value):
|
||||||
elif key_type == "enum":
|
elif key_type == "enum":
|
||||||
if value not in settings[key]["choices"]:
|
if value not in settings[key]["choices"]:
|
||||||
raise YunohostError('global_settings_bad_choice_for_enum', setting=key,
|
raise YunohostError('global_settings_bad_choice_for_enum', setting=key,
|
||||||
received_type=type(value).__name__,
|
choice=value,
|
||||||
expected_type=", ".join(settings[key]["choices"]))
|
available_choices=", ".join(settings[key]["choices"]))
|
||||||
else:
|
else:
|
||||||
raise YunohostError('global_settings_unknown_type', setting=key,
|
raise YunohostError('global_settings_unknown_type', setting=key,
|
||||||
unknown_type=key_type)
|
unknown_type=key_type)
|
||||||
|
|
Loading…
Add table
Reference in a new issue