Commit 6d4d56db authored by Daniel STAN's avatar Daniel STAN

methode mail: adresse de contact d'un adh

parent 50efa40d
......@@ -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],
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment