From: jlaine Date: Mon, 11 Apr 2011 14:44:40 +0000 (+0000) Subject: rework X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=9e27d57f8a65302eff3a71564b454b1dc8efce80;p=matthijs%2Fupstream%2Fdjango-ldapdb.git rework git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@1046 e071eeec-0327-468d-9b6a-08194a12b294 --- diff --git a/ldapdb/__init__.py b/ldapdb/__init__.py index dde6304..1aa9007 100644 --- a/ldapdb/__init__.py +++ b/ldapdb/__init__.py @@ -32,11 +32,8 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -from django import db from django.conf import settings -from ldapdb.router import Router - def escape_ldap_filter(value): value = unicode(value) return value.replace('\\', '\\5c') \ @@ -47,13 +44,15 @@ def escape_ldap_filter(value): # Legacy single database support if hasattr(settings, 'LDAPDB_SERVER_URI'): + from django import db + from ldapdb.router import Router + # Add the LDAP backend settings.DATABASES['ldap'] = { 'ENGINE': 'ldapdb.backends.ldap', 'NAME': settings.LDAPDB_SERVER_URI, 'USER': settings.LDAPDB_BIND_DN, 'PASSWORD': settings.LDAPDB_BIND_PASSWORD} - connection = db.connections['ldap'] # Add the LDAP router db.router.routers.append(Router())