mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
identation fix -_-
This commit is contained in:
parent
a8572559ac
commit
65cbe183ea
1 changed files with 4 additions and 4 deletions
|
@ -93,7 +93,7 @@ def user_create(username, firstname, lastname, mail, password):
|
||||||
#if not os.system("getent passwd " + username):
|
#if not os.system("getent passwd " + username):
|
||||||
# raise YunoHostError(17, _("Username not available"))
|
# raise YunoHostError(17, _("Username not available"))
|
||||||
|
|
||||||
if mail[mail.find('@')+1:] not in domain_list()['Domains']:
|
if mail[mail.find('@')+1:] not in domain_list()['Domains']:
|
||||||
raise YunoHostError(22, _("Domain not found : ")+ mail[mail.find('@')+1:])
|
raise YunoHostError(22, _("Domain not found : ")+ mail[mail.find('@')+1:])
|
||||||
|
|
||||||
# Get random UID/GID
|
# Get random UID/GID
|
||||||
|
@ -189,7 +189,7 @@ def user_update(username, firstname=None, lastname=None, mail=None, change_passw
|
||||||
with YunoHostLDAP() as yldap:
|
with YunoHostLDAP() as yldap:
|
||||||
attrs_to_fetch = ['givenName', 'sn', 'mail', 'maildrop']
|
attrs_to_fetch = ['givenName', 'sn', 'mail', 'maildrop']
|
||||||
new_attr_dict = {}
|
new_attr_dict = {}
|
||||||
domains = domain_list()['Domains']
|
domains = domain_list()['Domains']
|
||||||
|
|
||||||
# Populate user informations
|
# Populate user informations
|
||||||
result = yldap.search(base='ou=users,dc=yunohost,dc=org', filter='uid=' + username, attrs=attrs_to_fetch)
|
result = yldap.search(base='ou=users,dc=yunohost,dc=org', filter='uid=' + username, attrs=attrs_to_fetch)
|
||||||
|
@ -217,7 +217,7 @@ def user_update(username, firstname=None, lastname=None, mail=None, change_passw
|
||||||
|
|
||||||
if mail:
|
if mail:
|
||||||
yldap.validate_uniqueness({ 'mail': mail })
|
yldap.validate_uniqueness({ 'mail': mail })
|
||||||
if mail[mail.find('@')+1:] not in domains:
|
if mail[mail.find('@')+1:] not in domains:
|
||||||
raise YunoHostError(22, _("Domain not found : ")+ mail[mail.find('@')+1:])
|
raise YunoHostError(22, _("Domain not found : ")+ mail[mail.find('@')+1:])
|
||||||
del user['mail'][0]
|
del user['mail'][0]
|
||||||
new_attr_dict['mail'] = [mail] + user['mail']
|
new_attr_dict['mail'] = [mail] + user['mail']
|
||||||
|
@ -227,7 +227,7 @@ def user_update(username, firstname=None, lastname=None, mail=None, change_passw
|
||||||
add_mailalias = [ add_mailalias ]
|
add_mailalias = [ add_mailalias ]
|
||||||
for mail in add_mailalias:
|
for mail in add_mailalias:
|
||||||
yldap.validate_uniqueness({ 'mail': mail })
|
yldap.validate_uniqueness({ 'mail': mail })
|
||||||
if mail[mail.find('@')+1:] not in domains:
|
if mail[mail.find('@')+1:] not in domains:
|
||||||
raise YunoHostError(22, _("Domain not found : ")+ mail[mail.find('@')+1:])
|
raise YunoHostError(22, _("Domain not found : ")+ mail[mail.find('@')+1:])
|
||||||
user['mail'].append(mail)
|
user['mail'].append(mail)
|
||||||
new_attr_dict['mail'] = user['mail']
|
new_attr_dict['mail'] = user['mail']
|
||||||
|
|
Loading…
Reference in a new issue