Skip to content

Commit

Permalink
Exchanging ldap3 constants in if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
1kastner authored and jfautley committed Mar 31, 2022
1 parent 2a0956a commit 8b294f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ldapauthenticator/ldapauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def get_connection(self, userdn, password):
self.server_address, port=self.server_port, use_ssl=self.use_ssl
)
auto_bind = (
self.use_ssl and ldap3.AUTO_BIND_TLS_BEFORE_BIND or ldap3.AUTO_BIND_NO_TLS
ldap3.AUTO_BIND_NO_TLS if use_ssl else ldap3.AUTO_BIND_TLS_BEFORE_BIND
)
conn = ldap3.Connection(
server, user=userdn, password=password, auto_bind=auto_bind
Expand Down

0 comments on commit 8b294f4

Please sign in to comment.