[Python-modules-commits] [django-python3-ldap] 01/05: Import django-python3-ldap_0.9.11.orig.tar.gz
Michael Fladischer
fladi at moszumanska.debian.org
Sat Nov 12 11:38:49 UTC 2016
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch master
in repository django-python3-ldap.
commit b1f61480b326f879be6773e8a71bbee3cc4a417e
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Sat Nov 12 12:24:46 2016 +0100
Import django-python3-ldap_0.9.11.orig.tar.gz
---
PKG-INFO | 2 +-
django_python3_ldap.egg-info/PKG-INFO | 2 +-
django_python3_ldap.egg-info/requires.txt | 2 +-
django_python3_ldap/__init__.py | 2 +-
django_python3_ldap/ldap.py | 13 +++++++++----
django_python3_ldap/tests.py | 2 +-
setup.cfg | 2 +-
setup.py | 2 +-
8 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index ac35472..e0d7f0f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: django-python3-ldap
-Version: 0.9.10
+Version: 0.9.11
Summary: Django LDAP user authentication backend for Python 3.
Home-page: https://github.com/etianen/django-python3-ldap
Author: Dave Hall
diff --git a/django_python3_ldap.egg-info/PKG-INFO b/django_python3_ldap.egg-info/PKG-INFO
index ac35472..e0d7f0f 100644
--- a/django_python3_ldap.egg-info/PKG-INFO
+++ b/django_python3_ldap.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: django-python3-ldap
-Version: 0.9.10
+Version: 0.9.11
Summary: Django LDAP user authentication backend for Python 3.
Home-page: https://github.com/etianen/django-python3-ldap
Author: Dave Hall
diff --git a/django_python3_ldap.egg-info/requires.txt b/django_python3_ldap.egg-info/requires.txt
index b1c41e9..2adeecc 100644
--- a/django_python3_ldap.egg-info/requires.txt
+++ b/django_python3_ldap.egg-info/requires.txt
@@ -1,2 +1,2 @@
django>=1.7
-ldap3>=0.9.8.4,!=0.9.9.2
+ldap3>=0.9.8.4,<=1.4.0,!=0.9.9.2
diff --git a/django_python3_ldap/__init__.py b/django_python3_ldap/__init__.py
index 01d26d8..bd222f3 100644
--- a/django_python3_ldap/__init__.py
+++ b/django_python3_ldap/__init__.py
@@ -3,4 +3,4 @@ Django LDAP user authentication backend for Python 3.
"""
-__version__ = (0, 9, 10)
+__version__ = (0, 9, 11)
diff --git a/django_python3_ldap/ldap.py b/django_python3_ldap/ldap.py
index 4a1e66f..a377c33 100644
--- a/django_python3_ldap/ldap.py
+++ b/django_python3_ldap/ldap.py
@@ -37,8 +37,13 @@ class Connection(object):
If the user does not exist, then it will be created.
"""
+
+ attributes = user_data.get("attributes")
+ if attributes is None:
+ return None
+
User = get_user_model()
- attributes = user_data["attributes"]
+
# Create the user data.
user_fields = {
field_name: attributes.get(attribute_name, ("",))[0]
@@ -75,12 +80,12 @@ class Connection(object):
get_operational_attributes = True,
paged_size = 30,
)
- return (
+ return filter(None, (
self._get_or_create_user(entry)
for entry
in paged_entries
if entry["type"] == "searchResEntry"
- )
+ ))
def get_user(self, **kwargs):
"""
@@ -128,7 +133,7 @@ def connection(**kwargs):
else:
auto_bind = ldap3.AUTO_BIND_NO_TLS
try:
- with ldap3.Connection(ldap3.Server(settings.LDAP_AUTH_URL), user=username, password=password, auto_bind=auto_bind) as c:
+ with ldap3.Connection(ldap3.Server(settings.LDAP_AUTH_URL, allowed_referral_hosts=[("*", True)]), user=username, password=password, auto_bind=auto_bind) as c:
yield Connection(c)
except ldap3.LDAPBindError as ex:
logger.info("LDAP login failed: {ex}".format(ex=ex))
diff --git a/django_python3_ldap/tests.py b/django_python3_ldap/tests.py
index 124e00c..556e6ff 100644
--- a/django_python3_ldap/tests.py
+++ b/django_python3_ldap/tests.py
@@ -103,7 +103,7 @@ class TestLdap(TestCase):
self.assertIsInstance(user, User)
self.assertEqual(user.username, settings.LDAP_AUTH_TEST_USER_USERNAME)
- # User syncronisation.
+ # User synchronisation.
def testSyncUsersCreatesUsers(self):
call_command("ldap_sync_users", verbosity=0)
diff --git a/setup.cfg b/setup.cfg
index ebbec92..861a9f5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
[egg_info]
tag_build =
-tag_svn_revision = 0
tag_date = 0
+tag_svn_revision = 0
diff --git a/setup.py b/setup.py
index 5313850..6d2ac2f 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ setup(
packages = find_packages(),
install_requires = [
"django>=1.7",
- "ldap3>=0.9.8.4,!=0.9.9.2",
+ "ldap3>=0.9.8.4,<=1.4.0,!=0.9.9.2",
],
classifiers = [
"Development Status :: 4 - Beta",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-python3-ldap.git
More information about the Python-modules-commits
mailing list