[mod] also display app label on remove_domain with apps

This commit is contained in:
Laurent Peuch 2021-01-01 17:44:07 +01:00
parent d31ba05a26
commit c7d315c7e0

View file

@ -182,7 +182,7 @@ def domain_remove(operation_logger, domain, force=False):
"""
from yunohost.hook import hook_callback
from yunohost.app import app_ssowatconf
from yunohost.app import app_ssowatconf, app_info
from yunohost.utils.ldap import _get_ldap_interface
if not force and domain not in domain_list()['domains']:
@ -204,8 +204,9 @@ def domain_remove(operation_logger, domain, force=False):
for app in _installed_apps():
settings = _get_app_settings(app)
label = app_info(app)["name"]
if settings.get("domain") == domain:
apps_on_that_domain.append("%s (on https://%s%s)" % (app, domain, settings["path"]) if "path" in settings else app)
apps_on_that_domain.append("%s \"%s\" (on https://%s%s)" % (app, label, domain, settings["path"]) if "path" in settings else app)
if apps_on_that_domain:
raise YunohostError('domain_uninstall_app_first', apps=", ".join(apps_on_that_domain))