[ldapfeed] properly mark email address as encountered during import to avoid deleting them
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 15 May 2012 10:32:53 +0200
changeset 8400 0ae27909e45b
parent 8399 0ea4ccf1d9a6
child 8401 a9efb25337da
[ldapfeed] properly mark email address as encountered during import to avoid deleting them
sobjects/ldapparser.py
--- a/sobjects/ldapparser.py	Fri May 11 10:14:51 2012 +0200
+++ b/sobjects/ldapparser.py	Tue May 15 10:32:53 2012 +0200
@@ -104,6 +104,10 @@
                     entity.set_relations(use_email=email)
                 else:
                     entity.set_relations(primary_email=email)
+            elif self.sourceuris:
+                # pop from sourceuris anyway, else email may be removed by the
+                # source once import is finished
+                self.sourceuris.pop(str(userdict['dn'] + '@@' + emailaddr), None)
             # XXX else check use_email relation?
 
     @cached