Revert a few unecessary changes / polish code

This commit is contained in:
Alexandre Aubin 2020-08-27 17:31:17 +02:00
parent 78a2d012bb
commit 4a15358ed9
2 changed files with 8 additions and 6 deletions

View file

@ -1366,6 +1366,9 @@ tools:
postinstall: postinstall:
action_help: YunoHost post-install action_help: YunoHost post-install
api: POST /postinstall 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: arguments:
-d: -d:
full: --domain full: --domain
@ -1373,7 +1376,7 @@ tools:
extra: extra:
ask: ask_main_domain ask: ask_main_domain
pattern: *pattern_domain pattern: *pattern_domain
required: False required: True
-p: -p:
full: --password full: --password
help: YunoHost admin password help: YunoHost admin password

View file

@ -34,7 +34,7 @@ import string
import subprocess import subprocess
import copy import copy
from moulinette import m18n from moulinette import msignals, msettings, m18n
from moulinette.utils.log import getActionLogger from moulinette.utils.log import getActionLogger
from moulinette.utils.filesystem import read_json, write_to_json, read_yaml, write_to_yaml 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 # Ensure sufficiently complex password
assert_password_is_strong_enough("user", 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 domain is None:
if msettings.get('interface') == 'api': if msettings.get('interface') == 'api':
raise YunohostError('Invalide usage, specify domain argument') 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']: if domain not in domain_list()['domains']:
raise YunohostError('domain_unknown', domain) raise YunohostError('domain_unknown', domain)
mail=username+'@'+ domain mail = username + '@' + domain
ldap = _get_ldap_interface() ldap = _get_ldap_interface()
if username in user_list()["users"]: if username in user_list()["users"]: