mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Raise a error is path is not available
This commit is contained in:
parent
412c656a9b
commit
d656d5b4ba
1 changed files with 12 additions and 1 deletions
|
@ -464,7 +464,18 @@ def app_change_url(operation_logger, auth, app, domain, path):
|
||||||
if (domain, path) == (old_domain, old_path):
|
if (domain, path) == (old_domain, old_path):
|
||||||
raise YunohostError("app_change_url_identical_domains", domain=domain, path=path)
|
raise YunohostError("app_change_url_identical_domains", domain=domain, path=path)
|
||||||
|
|
||||||
_get_conflicting_apps(auth, domain, path)
|
# Check the url is available
|
||||||
|
conflicts = _get_conflicting_apps(auth, domain, path)
|
||||||
|
if conflicts:
|
||||||
|
apps = []
|
||||||
|
for path, app_id, app_label in conflicts:
|
||||||
|
apps.append(" * {domain:s}{path:s} → {app_label:s} ({app_id:s})".format(
|
||||||
|
domain=domain,
|
||||||
|
path=path,
|
||||||
|
app_id=app_id,
|
||||||
|
app_label=app_label,
|
||||||
|
))
|
||||||
|
raise YunohostError('app_location_unavailable', apps="\n".join(apps))
|
||||||
|
|
||||||
manifest = json.load(open(os.path.join(APPS_SETTING_PATH, app, "manifest.json")))
|
manifest = json.load(open(os.path.join(APPS_SETTING_PATH, app, "manifest.json")))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue