diff --git a/src/migrations/0026_new_admins_group.py b/src/migrations/0026_new_admins_group.py index 87ea26907..e44f1d716 100644 --- a/src/migrations/0026_new_admins_group.py +++ b/src/migrations/0026_new_admins_group.py @@ -37,22 +37,6 @@ class MyMigration(Migration): new_admin_user = user break - # NB: we handle the edge-case where no user exist at all - # which is useful for the CI etc. - if all_users and not new_admin_user: - new_admin_user = os.environ.get("YNH_NEW_ADMIN_USER") - if new_admin_user: - assert new_admin_user in all_users, f"{new_admin_user} is not an existing yunohost user" - else: - raise YunohostError( - # FIXME: i18n - """The very first user created on this Yunohost instance could not be found, and therefore this migration can not be ran. You should re-run this migration as soon as possible from the command line with, after choosing which user should become the admin: - -export YNH_NEW_ADMIN_USER=some_existing_username -yunohost tools migrations run""", - raw_msg=True - ) - self.ldap_migration_started = True if new_admin_user: diff --git a/src/tests/test_permission.py b/src/tests/test_permission.py index f2bff5507..379f1cf39 100644 --- a/src/tests/test_permission.py +++ b/src/tests/test_permission.py @@ -109,7 +109,7 @@ def clean_user_groups_permission(): user_delete(u) for g in user_group_list()["groups"]: - if g not in ["all_users", "visitors"]: + if g not in ["all_users", "visitors", "admins"]: user_group_delete(g) for p in user_permission_list()["permissions"]: diff --git a/src/user.py b/src/user.py index efffbdc7e..e00fa3685 100644 --- a/src/user.py +++ b/src/user.py @@ -56,7 +56,7 @@ FIELDS_FOR_IMPORT = { "groups": r"^|([a-z0-9_]+(,?[a-z0-9_]+)*)$", } -ADMIN_ALIASES = ["root@", "admin@", "webmaster@", "postmaster@", "abuse@"] +ADMIN_ALIASES = ["root@", "admin@", "admins", "webmaster@", "postmaster@", "abuse@"] def user_list(fields=None):