mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
portal: more explicit errors with path
This commit is contained in:
parent
587d729d60
commit
d7166bf77f
2 changed files with 6 additions and 2 deletions
|
@ -501,6 +501,7 @@
|
||||||
"invalid_number": "Must be a number",
|
"invalid_number": "Must be a number",
|
||||||
"invalid_number_max": "Must be lesser than {max}",
|
"invalid_number_max": "Must be lesser than {max}",
|
||||||
"invalid_number_min": "Must be greater than {min}",
|
"invalid_number_min": "Must be greater than {min}",
|
||||||
|
"invalid_password": "Invalid password",
|
||||||
"invalid_regex": "Invalid regex:'{regex}'",
|
"invalid_regex": "Invalid regex:'{regex}'",
|
||||||
"invalid_shell": "Invalid shell: {shell}",
|
"invalid_shell": "Invalid shell: {shell}",
|
||||||
"ip6tables_unavailable": "You cannot play with ip6tables here. You are either in a container or your kernel does not support it",
|
"ip6tables_unavailable": "You cannot play with ip6tables here. You are either in a container or your kernel does not support it",
|
||||||
|
@ -561,6 +562,7 @@
|
||||||
"log_user_permission_update": "Update accesses for permission '{}'",
|
"log_user_permission_update": "Update accesses for permission '{}'",
|
||||||
"log_user_update": "Update info for user '{}'",
|
"log_user_update": "Update info for user '{}'",
|
||||||
"mail_alias_remove_failed": "Could not remove e-mail alias '{mail}'",
|
"mail_alias_remove_failed": "Could not remove e-mail alias '{mail}'",
|
||||||
|
"mail_already_exists": "Mail adress '{mail}' already exists",
|
||||||
"mail_domain_unknown": "Invalid e-mail address for domain '{domain}'. Please, use a domain administrated by this server.",
|
"mail_domain_unknown": "Invalid e-mail address for domain '{domain}'. Please, use a domain administrated by this server.",
|
||||||
"mail_forward_remove_failed": "Could not remove e-mail forwarding '{mail}'",
|
"mail_forward_remove_failed": "Could not remove e-mail forwarding '{mail}'",
|
||||||
"mail_unavailable": "This e-mail address is reserved for the admins group",
|
"mail_unavailable": "This e-mail address is reserved for the admins group",
|
||||||
|
|
|
@ -199,8 +199,10 @@ def portal_update(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ldap_interface.validate_uniqueness({"mail": mail})
|
ldap_interface.validate_uniqueness({"mail": mail})
|
||||||
except Exception as e:
|
except YunohostError:
|
||||||
raise YunohostError("user_update_failed", user=username, error=e)
|
raise YunohostValidationError(
|
||||||
|
"mail_already_exists", mail=mail, path=f"mailalias[{index}]"
|
||||||
|
)
|
||||||
|
|
||||||
if domain not in domains:
|
if domain not in domains:
|
||||||
raise YunohostValidationError(
|
raise YunohostValidationError(
|
||||||
|
|
Loading…
Add table
Reference in a new issue