methode mail: adresse de contact d'un adh
This commit is contained in:
parent
50efa40d8c
commit
6d4d56db72
1 changed files with 11 additions and 0 deletions
11
objets.py
11
objets.py
|
@ -951,6 +951,17 @@ class proprio(CransLdapObject):
|
|||
machine.delete(comm, login)
|
||||
super(proprio, self).delete(comm, login)
|
||||
|
||||
def get_mail(self):
|
||||
"""Renvoie un mail de contact valide, or None"""
|
||||
mails = ( self.get('canonicalAlias', []) or \
|
||||
self.get('mail', []))
|
||||
if not mails or \
|
||||
any(b['type'] == 'mail_invalide' and b['fin'] == '-'
|
||||
for b in self.get('blacklist', []) ):
|
||||
return None
|
||||
return mails[0].value
|
||||
|
||||
|
||||
class machine(CransLdapObject):
|
||||
u""" Une machine """
|
||||
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur, attributs.parent, attributs.respo],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue