[SOGo] On patche un peu partout pour pouvoir rendre le champ mail de ldap plus propre.

Ignore-this: aed0fb0c7f88d3feb1f0be35b11780bf

darcs-hash:20121201132852-b6762-f77d73b568bc1ad0fef3c9341cb2a00a34a09a0c.gz
This commit is contained in:
Pierre-Elliott Bécue 2012-12-01 14:28:52 +01:00
parent e6777ccb12
commit ab6202f37c
5 changed files with 21 additions and 14 deletions

View file

@ -421,7 +421,7 @@ def set_mail_ext(adher):
Demande l'adresse mail extérieure d'un adhérent
"""
default = adher.mail()
if default.find('@') == -1:
if default.endswith('@crans.org'):
# C'était une adresse crans
default = ''
@ -663,7 +663,7 @@ def del_adher(adher):
return
quoi = u'Toutes les machines associées à cet adhérent seront détruites'
if adher.mail().find('@') == -1:
if adher._data.get('uid', '') != '':
# L'adhérent a un compte
machines = adher.machines()
if not machines:
@ -1631,7 +1631,8 @@ def new_adher(adher):
no, res = dialog(arg)
if not no:
mail = adher.mail()
if mail.find('@') == -1: mail += '@crans.org'
if adher._data.get('uid', '') != '' and not mail.endswith('@crans.org'):
mail += '@crans.org'
adher.services_to_restart('ML_ens', [mail])
def modif_adher(adher):