apps: people insist on trying to install Nextcloud after creating a user called nextcloud ... So let's check this stupid case

This commit is contained in:
Alexandre Aubin 2024-01-21 21:14:02 +01:00
parent 4ed5e1ba20
commit fc12cb198c

View file

@ -1068,6 +1068,7 @@ def app_install(
) )
from yunohost.regenconf import manually_modified_files from yunohost.regenconf import manually_modified_files
from yunohost.utils.legacy import _patch_legacy_php_versions, _patch_legacy_helpers from yunohost.utils.legacy import _patch_legacy_php_versions, _patch_legacy_helpers
from yunohost.user import user_list
# Check if disk space available # Check if disk space available
if free_space_in_directory("/") <= 512 * 1000 * 1000: if free_space_in_directory("/") <= 512 * 1000 * 1000:
@ -1091,6 +1092,9 @@ def app_install(
app_id = manifest["id"] app_id = manifest["id"]
if app_id in user_list()["users"].keys():
raise YunohostValidationError(f"There is already a YunoHost user called {app_id} ...", raw_msg=True)
# Check requirements # Check requirements
for name, passed, values, err in _check_manifest_requirements( for name, passed, values, err in _check_manifest_requirements(
manifest, action="install" manifest, action="install"