get_mail:les clubs n'ont ni mail ni canonicalAlias
This commit is contained in:
parent
8892e90579
commit
996950b6df
1 changed files with 6 additions and 2 deletions
|
@ -965,12 +965,16 @@ class proprio(CransLdapObject):
|
||||||
def get_mail(self):
|
def get_mail(self):
|
||||||
"""Renvoie un mail de contact valide, or None"""
|
"""Renvoie un mail de contact valide, or None"""
|
||||||
mails = ( self.get('canonicalAlias', []) or \
|
mails = ( self.get('canonicalAlias', []) or \
|
||||||
self.get('mail', []))
|
self.get('mail', []) or \
|
||||||
|
self.get('uid', []))
|
||||||
if not mails or \
|
if not mails or \
|
||||||
any(b['type'] == 'mail_invalide' and b['fin'] == '-'
|
any(b['type'] == 'mail_invalide' and b['fin'] == '-'
|
||||||
for b in self.get('blacklist', []) ):
|
for b in self.get('blacklist', []) ):
|
||||||
return None
|
return None
|
||||||
return mails[0].value
|
mail = mails[0].value
|
||||||
|
if '@' not in mail:
|
||||||
|
mail += '@crans.org'
|
||||||
|
return mail
|
||||||
|
|
||||||
|
|
||||||
class machine(CransLdapObject):
|
class machine(CransLdapObject):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue