From 923d72814b490e6823b67732c9e0720ac8c43b8f Mon Sep 17 00:00:00 2001 From: opi Date: Wed, 4 May 2016 09:53:19 +0200 Subject: [PATCH] [fix] Can install app on domain root even if another app is installed in a sub folder. --- src/yunohost/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index a9ff2eb72..582f8e065 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -904,6 +904,11 @@ def app_checkurl(auth, url, app=None): raise MoulinetteError(errno.EINVAL, m18n.n('domain_unknown')) if domain in apps_map: + # Domain already has apps on sub path + if path == '/': + raise MoulinetteError(errno.EPERM, + m18n.n('app_location_install_failed')) + # Loop through apps for p, a in apps_map[domain].items(): # Skip requested app checking if app is not None and a['id'] == app: @@ -912,7 +917,7 @@ def app_checkurl(auth, url, app=None): if path == p: raise MoulinetteError(errno.EINVAL, m18n.n('app_location_already_used')) - elif path.startswith(p) and p.count('/') < path.count('/'): + elif path.startswith(p): raise MoulinetteError(errno.EPERM, m18n.n('app_location_install_failed'))