[ux] add command instructions and suggest change-url for domain_uninstall_app_first

This commit is contained in:
Laurent Peuch 2021-01-01 19:13:43 +01:00
parent c7d315c7e0
commit e51a1b670e
2 changed files with 3 additions and 3 deletions

View file

@ -277,7 +277,7 @@
"domain_dyndns_root_unknown": "Unknown DynDNS root domain",
"domain_exists": "The domain already exists",
"domain_hostname_failed": "Unable to set new hostname. This might cause an issue later (it might be fine).",
"domain_uninstall_app_first": "Those applications are still installed on your domain: {apps}. Please uninstall them before proceeding to domain removal",
"domain_uninstall_app_first": "Those applications are still installed on your domain:\n{apps}\n\nPlease uninstall them using 'yunohost app remove the_app_id' or move them to another domain using 'yunohost app change-url the_app_id' before proceeding to domain removal",
"domain_name_unknown": "Domain '{domain}' unknown",
"domain_unknown": "Unknown domain",
"domains_available": "Available domains:",

View file

@ -206,10 +206,10 @@ def domain_remove(operation_logger, domain, force=False):
settings = _get_app_settings(app)
label = app_info(app)["name"]
if settings.get("domain") == domain:
apps_on_that_domain.append("%s \"%s\" (on https://%s%s)" % (app, label, 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))
raise YunohostError('domain_uninstall_app_first', apps="\n".join(apps_on_that_domain))
operation_logger.start()
ldap = _get_ldap_interface()