mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[enh] Prepend a message with argument name on check pattern failure
This commit is contained in:
parent
5d12977f10
commit
e66188ecc3
3 changed files with 4 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
|||
"ldap_attribute_already_exists" : "Attribute already exists: '{:s}={:s}'",
|
||||
|
||||
"argument_required" : "Argument {:s} is required",
|
||||
"invalid_argument": "Invalid argument '{:s}': {:s}",
|
||||
"password" : "Password",
|
||||
"invalid_password" : "Invalid password",
|
||||
"confirm" : "Confirm {:s}",
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"ldap_attribute_already_exists" : "L'attribut existe déjà : '{:s}={:s}'",
|
||||
|
||||
"argument_required" : "L'argument {:s} est requis",
|
||||
"invalid_argument": "Argument '{:s}' incorrect : {:s}",
|
||||
"password" : "Mot de passe",
|
||||
"invalid_password" : "Mot de passe incorrect",
|
||||
"confirm" : "Confirmez le {:s}",
|
||||
|
|
|
@ -152,7 +152,8 @@ class PatternParameter(_ExtraParameter):
|
|||
v = arg_value
|
||||
|
||||
if v and not re.match(pattern, v or '', re.UNICODE):
|
||||
raise MoulinetteError(errno.EINVAL, m18n.n(message))
|
||||
raise MoulinetteError(errno.EINVAL, m18n.g('invalid_argument',
|
||||
arg_name, m18n.n(message)))
|
||||
return arg_value
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Add table
Reference in a new issue