mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
postinstall: raise a proper error when trying to use e.g. 'admin' as the first username which will conflict with the admins group mail aliases
This commit is contained in:
parent
58ac633d80
commit
475c93d582
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue