diff --git a/src/tools.py b/src/tools.py index f5a89a22a..0ff6842ea 100644 --- a/src/tools.py +++ b/src/tools.py @@ -161,7 +161,7 @@ def tools_postinstall( assert_password_is_compatible, ) from yunohost.domain import domain_main_domain - from yunohost.user import user_create + from yunohost.user import user_create, ADMIN_ALIASES import psutil # Do some checks at first @@ -174,6 +174,9 @@ def tools_postinstall( raw_msg=True, ) + if username in ADMIN_ALIASES: + raise YunohostValidationError(f"Unfortunately, {username} cannot be used as a username", raw_msg=True) + # Check there's at least 10 GB on the rootfs... disk_partitions = sorted( psutil.disk_partitions(all=True), key=lambda k: k.mountpoint