From 8c00727456c434dc806654568e8df4a61f6be7f2 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sat, 28 Nov 2015 03:05:40 +0100 Subject: [PATCH] Retire les bl mail invalide quand on modifie le champ mail ou mailext --- gestion/dialog/adherent.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gestion/dialog/adherent.py b/gestion/dialog/adherent.py index c222a137..ecf4fb56 100644 --- a/gestion/dialog/adherent.py +++ b/gestion/dialog/adherent.py @@ -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()