Skip to content
Snippets Groups Projects
Commit 315a05c9 authored by theneedyguy's avatar theneedyguy Committed by GitHub
Browse files

Fix for python3

This fixes an attribute error
parent c2467322
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
import re
from functools import wraps
import ldap
import sys
from ldap import filter as ldap_filter
from flask import abort, current_app, g, make_response, redirect, url_for, \
request
......@@ -149,6 +150,9 @@ class LDAP(object):
return
try:
conn = self.initialize
if sys.version_info[0] > 2:
conn.simple_bind_s(user_dn, password)
else:
conn.simple_bind_s(user_dn.decode('utf-8'), password)
return True
except ldap.LDAPError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment