mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Use named arguments for user_unknown string.
This commit is contained in:
parent
4cabb2f7f9
commit
394f0498a5
3 changed files with 4 additions and 7 deletions
|
@ -195,7 +195,7 @@
|
||||||
"mail_domain_unknown" : "Unknown mail address domain '{domain:s}'",
|
"mail_domain_unknown" : "Unknown mail address domain '{domain:s}'",
|
||||||
"mail_alias_remove_failed" : "Unable to remove mail alias '{mail:s}'",
|
"mail_alias_remove_failed" : "Unable to remove mail alias '{mail:s}'",
|
||||||
"mail_forward_remove_failed" : "Unable to remove mail forward '{mail:s}'",
|
"mail_forward_remove_failed" : "Unable to remove mail forward '{mail:s}'",
|
||||||
"user_unknown" : "Unknown user",
|
"user_unknown" : "Unknown user: {user:s}",
|
||||||
"system_username_exists" : "Username already exists in the system users",
|
"system_username_exists" : "Username already exists in the system users",
|
||||||
"user_creation_failed" : "Unable to create user",
|
"user_creation_failed" : "Unable to create user",
|
||||||
"user_created" : "User successfully created",
|
"user_created" : "User successfully created",
|
||||||
|
|
|
@ -626,10 +626,7 @@ def app_addaccess(auth, apps, users=[]):
|
||||||
try:
|
try:
|
||||||
user_info(auth, allowed_user)
|
user_info(auth, allowed_user)
|
||||||
except MoulinetteError:
|
except MoulinetteError:
|
||||||
# FIXME: Add username keyword in user_unknown
|
logger.warning(m18n.n('user_unknown', user=allowed_user))
|
||||||
logger.warning('{0}{1}'.format(
|
|
||||||
m18n.g('colon', m18n.n('user_unknown')),
|
|
||||||
allowed_user))
|
|
||||||
continue
|
continue
|
||||||
allowed_users.add(allowed_user)
|
allowed_users.add(allowed_user)
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ def user_update(auth, username, firstname=None, lastname=None, mail=None,
|
||||||
# Populate user informations
|
# Populate user informations
|
||||||
result = auth.search(base='ou=users,dc=yunohost,dc=org', filter='uid=' + username, attrs=attrs_to_fetch)
|
result = auth.search(base='ou=users,dc=yunohost,dc=org', filter='uid=' + username, attrs=attrs_to_fetch)
|
||||||
if not result:
|
if not result:
|
||||||
raise MoulinetteError(errno.EINVAL, m18n.n('user_unknown'))
|
raise MoulinetteError(errno.EINVAL, m18n.n('user_unknown', user=username))
|
||||||
user = result[0]
|
user = result[0]
|
||||||
|
|
||||||
# Get modifications from arguments
|
# Get modifications from arguments
|
||||||
|
@ -381,7 +381,7 @@ def user_info(auth, username):
|
||||||
if result:
|
if result:
|
||||||
user = result[0]
|
user = result[0]
|
||||||
else:
|
else:
|
||||||
raise MoulinetteError(errno.EINVAL, m18n.n('user_unknown'))
|
raise MoulinetteError(errno.EINVAL, m18n.n('user_unknown', user=username))
|
||||||
|
|
||||||
result_dict = {
|
result_dict = {
|
||||||
'username': user['uid'][0],
|
'username': user['uid'][0],
|
||||||
|
|
Loading…
Add table
Reference in a new issue