check if user exists in app_addaccess()

This commit is contained in:
Kload 2013-03-03 18:56:27 +01:00
parent 0e8ea0d2ee
commit a1e632c8e1

View file

@ -9,6 +9,7 @@ import yaml
import time
from yunohost import YunoHostError, YunoHostLDAP, win_msg, random_password, lvl, is_true, lemon_configuration
from yunohost_domain import domain_list, domain_add
from yunohost_user import user_info
repo_path = '/var/cache/yunohost/repo'
apps_path = '/usr/share/yunohost/apps'
@ -419,7 +420,10 @@ def app_addaccess(apps, users):
for allowed_user in users:
if allowed_user not in new_users.split(' '):
# TODO: check if user exists
try:
user_info(allowed_user)
except YunoHostError:
continue
new_users = new_users +' '+ allowed_user
app_settings['allowed_users'] = new_users.strip()