Retire les bl mail invalide quand on modifie le champ mail ou mailext
This commit is contained in:
parent
e67b3be24b
commit
8c00727456
1 changed files with 9 additions and 0 deletions
|
@ -543,6 +543,15 @@ class Dialog(proprio.Dialog):
|
|||
with self.conn.search(dn=adherent.dn, scope=0, mode='rw')[0] as adherent:
|
||||
for (key, values) in attrs.items():
|
||||
adherent[key] = values
|
||||
# On retire les éventuelle bl mail invalide
|
||||
if key == u'mailExt' or key == u'mail':
|
||||
for bl in adherent['blacklist']:
|
||||
now = int(time.time())
|
||||
if bl['type'] == u'mail_invalide' and bl['fin'] > now:
|
||||
bl['fin'] = now
|
||||
if bl['debut'] > now:
|
||||
bl['debut'] = now
|
||||
bl['comm'] += u'- mail rectifié'
|
||||
adherent.validate_changes()
|
||||
adherent.history_gen()
|
||||
adherent.save()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue