From 5c49c8cdd7d582f4396563c346516e8476928063 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Fri, 10 May 2024 20:23:41 +0200 Subject: [PATCH] Fix for Flask-SimpleLDAP 2.0.0 --- cps/admin.py | 5 ++++- optional-requirements.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index b709764b..3382e566 100755 --- a/cps/admin.py +++ b/cps/admin.py @@ -1631,7 +1631,10 @@ def import_ldap_users(): imported = 0 for username in new_users: - user = username.decode('utf-8') + if isinstance(username, bytes): + user = username.decode('utf-8') + else: + user = username if '=' in user: # if member object field is empty take user object as filter if config.config_ldap_member_user_object: diff --git a/optional-requirements.txt b/optional-requirements.txt index f4f0d169..7b27a63e 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -21,7 +21,7 @@ python-Levenshtein>=0.12.0,<0.26.0 # ldap login python-ldap>=3.0.0,<3.5.0 -Flask-SimpleLDAP>=1.4.0,<1.5.0 +Flask-SimpleLDAP>=1.4.0,<2.1.0 # oauth Flask-Dance>=2.0.0,<7.1.0