From 24df76deb96800ffc5f5c38f23b9c78566c29075 Mon Sep 17 00:00:00 2001 From: Kload Date: Sun, 3 Mar 2013 18:56:27 +0100 Subject: [PATCH] check if user exists in app_addaccess() --- yunohost_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yunohost_app.py b/yunohost_app.py index d7a27ff2..178dfe95 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -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()