using a restartable strategy to get around login errors

This commit is contained in:
Dan Funk 2020-06-04 18:03:59 -04:00
parent 9cfe00dfd0
commit b6abb0cbe2
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ from attr import asdict
from ldap3.core.exceptions import LDAPExceptionError
from crc import app, db
from ldap3 import Connection, Server, MOCK_SYNC
from ldap3 import Connection, Server, MOCK_SYNC, RESTARTABLE
from crc.api.common import ApiError
from crc.models.ldap import LdapModel, LdapSchema
@ -34,7 +34,7 @@ class LdapService(object):
server = Server(app.config['LDAP_URL'], connect_timeout=app.config['LDAP_TIMEOUT_SEC'])
conn = Connection(server, auto_bind=True,
receive_timeout=app.config['LDAP_TIMEOUT_SEC'],
)
client_strategy=RESTARTABLE)
LdapService.conn = conn
return LdapService.conn