--- a/devtools/__init__.py Tue Feb 24 16:24:01 2009 +0100
+++ b/devtools/__init__.py Tue Feb 24 20:59:46 2009 +0100
@@ -260,6 +260,8 @@
- http://www.sqlite.org/cvstrac/tktview?tn=1327,33
(some dates are returned as strings rather thant date objects)
"""
+ if hasattr(querier.__class__, '_devtools_sqlite_patched'):
+ return # already monkey patched
def wrap_execute(base_execute):
def new_execute(*args, **kwargs):
rset = base_execute(*args, **kwargs)
@@ -288,7 +290,7 @@
return rset
return new_execute
querier.__class__.execute = wrap_execute(querier.__class__.execute)
-
+ querier.__class__._devtools_sqlite_patched = True
def init_test_database(driver='sqlite', configdir='data', config=None,
vreg=None):
--- a/server/sources/ldapuser.py Tue Feb 24 16:24:01 2009 +0100
+++ b/server/sources/ldapuser.py Tue Feb 24 20:59:46 2009 +0100
@@ -176,6 +176,10 @@
external repository
"""
self.info('synchronizing ldap source %s', self.uri)
+ try:
+ ldap_emailattr = self.user_rev_attrs['email']
+ except KeyError:
+ return # no email in ldap, we're done
session = self.repo.internal_session()
try:
cursor = session.system_sql("SELECT eid, extid FROM entities WHERE "
@@ -184,7 +188,7 @@
# if no result found, _search automatically delete entity information
res = self._search(session, extid, BASE)
if res:
- ldapemailaddr = res[0].get(self.user_rev_attrs['email'])
+ ldapemailaddr = res[0].get(ldap_emailattr)
if ldapemailaddr:
rset = session.execute('EmailAddress X,A WHERE '
'U use_email X, U eid %(u)s',