mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
check if user exists in app_addaccess()
This commit is contained in:
parent
0e8ea0d2ee
commit
a1e632c8e1
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue