[ldapfeed] use source's extid2eid, the repo's one will be deprecated in a near future.
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 23 Nov 2015 14:37:37 +0100
changeset 10913 5d7f17054ae6
parent 10912 addc7ba36f69
child 10914 fed8bd56f223
[ldapfeed] use source's extid2eid, the repo's one will be deprecated in a near future.
server/sources/ldapfeed.py
--- a/server/sources/ldapfeed.py	Tue Nov 24 14:36:41 2015 +0100
+++ b/server/sources/ldapfeed.py	Mon Nov 23 14:37:37 2015 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -262,9 +262,9 @@
         except Exception:
             self.error('while trying to authenticate %s', user, exc_info=True)
             raise AuthenticationError()
-        eid = self.repo.extid2eid(self, user['dn'].encode('ascii'), 'CWUser', cnx, insert=False)
-        if eid < 0:
-            # user has been moved away from this source
+        eid = self.repo.system_source.extid2eid(cnx, user['dn'].encode('ascii'))
+        if eid is None or eid < 0:
+            # user is not known or has been moved away from this source
             raise AuthenticationError()
         return eid