Revert "Revert "[fix] Can't restore app on a root domain""

This reverts commit 7717c58de4.
This commit is contained in:
Laurent Peuch 2016-12-15 16:33:46 +01:00
parent ac96f47fb0
commit eb1f6a77a9

View file

@ -917,10 +917,6 @@ 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
@ -930,7 +926,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):
elif path.startswith(p) or p.startswith(path):
raise MoulinetteError(errno.EPERM,
m18n.n('app_location_install_failed'))