[fix] Can install app on domain root even if another app is installed in a sub folder.

This commit is contained in:
opi 2016-05-04 09:53:19 +02:00 committed by Jérôme Lebleu
parent 5d91f48903
commit 923d72814b

View file

@ -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'))