From 4a15358ed9618df18701c57c15666167eaafa17f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 27 Aug 2020 17:31:17 +0200 Subject: [PATCH] Revert a few unecessary changes / polish code --- data/actionsmap/yunohost.yml | 7 +++++-- src/yunohost/user.py | 7 +++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 13a3cfaaf..803c5bfda 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -1338,7 +1338,7 @@ dyndns: tools: category_help: Specific tools actions: - + ### tools_adminpw() adminpw: action_help: Change password of admin and root users @@ -1366,6 +1366,9 @@ tools: postinstall: action_help: YunoHost post-install api: POST /postinstall + configuration: + # We need to be able to run the postinstall without being authenticated, otherwise we can't run the postinstall + authenticate: false arguments: -d: full: --domain @@ -1373,7 +1376,7 @@ tools: extra: ask: ask_main_domain pattern: *pattern_domain - required: False + required: True -p: full: --password help: YunoHost admin password diff --git a/src/yunohost/user.py b/src/yunohost/user.py index bd8252d0e..98dafc24d 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -34,7 +34,7 @@ import string import subprocess import copy -from moulinette import m18n +from moulinette import msignals, msettings, m18n from moulinette.utils.log import getActionLogger from moulinette.utils.filesystem import read_json, write_to_json, read_yaml, write_to_yaml @@ -126,8 +126,7 @@ def user_create(operation_logger, username, firstname, lastname, domain, passwor # Ensure sufficiently complex password assert_password_is_strong_enough("user", password) - from moulinette import msignals, msettings, m18n - from yunohost.domain import domain_list + if domain is None: if msettings.get('interface') == 'api': raise YunohostError('Invalide usage, specify domain argument') @@ -141,7 +140,7 @@ def user_create(operation_logger, username, firstname, lastname, domain, passwor if domain not in domain_list()['domains']: raise YunohostError('domain_unknown', domain) - mail=username+'@'+ domain + mail = username + '@' + domain ldap = _get_ldap_interface() if username in user_list()["users"]: