[attributs] Utilisation de mailExt comme mail de secours
On force l'adresse utilisée à être non crans
This commit is contained in:
parent
957c0462d1
commit
4a4b86f4f1
1 changed files with 5 additions and 1 deletions
|
@ -632,13 +632,17 @@ class mailExt(mail):
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
legend = u"Mail de secours (optionnel)"
|
legend = u"Mail de secours"
|
||||||
can_modify = [soi, cableur, nounou]
|
can_modify = [soi, cableur, nounou]
|
||||||
category = 'mail'
|
category = 'mail'
|
||||||
ldap_name = "mailExt"
|
ldap_name = "mailExt"
|
||||||
|
|
||||||
def parse_value(self, mail):
|
def parse_value(self, mail):
|
||||||
mail = mail.lower()
|
mail = mail.lower()
|
||||||
|
# comme on utilise mailExt comme mail de secours si l'utilisateur
|
||||||
|
# à perdu ses id crans, ça ne sert à rien de mettre ne adresse crans
|
||||||
|
if mail.endswith("@crans.org"):
|
||||||
|
raise ValueError("%s ne devrait pas être une adresse crans." % str(self.legend))
|
||||||
super(mailExt, self).parse_value(mail)
|
super(mailExt, self).parse_value(mail)
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue