We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8c8111 commit 047d68bCopy full SHA for 047d68b
django_python3_ldap/utils.py
@@ -6,7 +6,11 @@
6
import binascii
7
import itertools
8
9
-from django.utils.encoding import force_text
+try:
10
+ from django.utils.encoding import force_str
11
+except ImportError:
12
+ from django.utils.encoding import force_text as force_str
13
+
14
from django.utils.module_loading import import_string
15
16
from django_python3_ldap.conf import settings
@@ -27,8 +31,8 @@ def clean_ldap_name(name):
27
31
"""
28
32
return re.sub(
29
33
r'[^a-zA-Z0-9 _\-.@:*]',
30
- lambda c: "\\" + force_text(binascii.hexlify(c.group(0).encode("latin-1", errors="ignore"))).upper(),
- force_text(name),
34
+ lambda c: "\\" + force_str(binascii.hexlify(c.group(0).encode("latin-1", errors="ignore"))).upper(),
35
+ force_str(name),
36
)
37
38
0 commit comments