From fc12cb198c749d0acccb6a98efc2cc1429d4e84c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 21 Jan 2024 21:14:02 +0100 Subject: [PATCH] apps: people insist on trying to install Nextcloud after creating a user called nextcloud ... So let's check this stupid case --- src/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app.py b/src/app.py index 31242fe72..0534e093f 100644 --- a/src/app.py +++ b/src/app.py @@ -1068,6 +1068,7 @@ def app_install( ) from yunohost.regenconf import manually_modified_files from yunohost.utils.legacy import _patch_legacy_php_versions, _patch_legacy_helpers + from yunohost.user import user_list # Check if disk space available if free_space_in_directory("/") <= 512 * 1000 * 1000: @@ -1091,6 +1092,9 @@ def app_install( 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 for name, passed, values, err in _check_manifest_requirements( manifest, action="install"