summaryrefslogtreecommitdiff
path: root/ldap3/extend/microsoft/unlockAccount.py
diff options
context:
space:
mode:
authorAndrej Shadura <andrew.shadura@collabora.co.uk>2020-11-30 12:16:10 +0100
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2020-11-30 12:16:10 +0100
commitd7ea1d4c872a0ef39cce7a6bb6d2b9c9fd6c205e (patch)
tree509fcc27647de80e229c24babd4685ba04b45802 /ldap3/extend/microsoft/unlockAccount.py
parent2bcee5c91d65796532aef1b15f6c8c0c16197aee (diff)
parent96fb2df0e33b34a4dbb75577de8589a8611759c4 (diff)
Update upstream source from tag 'upstream/2.8.1'
Update to upstream version '2.8.1' with Debian dir 4d1ac29b7ae225ca99fb367a07e2e8183bc94036
Diffstat (limited to 'ldap3/extend/microsoft/unlockAccount.py')
-rw-r--r--ldap3/extend/microsoft/unlockAccount.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ldap3/extend/microsoft/unlockAccount.py b/ldap3/extend/microsoft/unlockAccount.py
index bc59b58..b1c65b8 100644
--- a/ldap3/extend/microsoft/unlockAccount.py
+++ b/ldap3/extend/microsoft/unlockAccount.py
@@ -33,14 +33,15 @@ from ...utils.dn import safe_dn
def ad_unlock_account(connection, user_dn, controls=None):
if connection.check_names:
user_dn = safe_dn(user_dn)
- result = connection.modify(user_dn,
- {'lockoutTime': [(MODIFY_REPLACE, ['0'])]},
- controls)
+ result = connection.modify(user_dn, {'lockoutTime': [(MODIFY_REPLACE, ['0'])]}, controls)
if not connection.strategy.sync:
_, result = connection.get_response(result)
else:
- result = connection.result
+ if connection.strategy.thread_safe:
+ _, result, _, _ = result
+ else:
+ result = connection.result
# change successful, returns True
if result['result'] == RESULT_SUCCESS: