From 341303bed154e8ad12778d8df8cece9e48c7c75e Mon Sep 17 00:00:00 2001 From: George Taylor Date: Thu, 25 Jul 2024 17:00:01 +0100 Subject: [PATCH] Fix update user role cmd (#57) * :ambulance: correct logic for matched user sets + role filtering * Formatted code with black --line-length 120 * Update role filter logic in user.py * Formatted code with black --line-length 120 * aliasing * Update user.py * Update user.py * Formatted code with black --line-length 120 --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- cli/ldap_cmds/user.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cli/ldap_cmds/user.py b/cli/ldap_cmds/user.py index 2f6d69b..3f67140 100644 --- a/cli/ldap_cmds/user.py +++ b/cli/ldap_cmds/user.py @@ -205,11 +205,8 @@ def update_roles(roles, user_ou, root_dn, add, remove, update_notes, user_note, raise e try: - role_filter_results = ldap_connection_role_filter.search_s( - ",".join([user_ou, root_dn]), - ldap.SCOPE_SUBTREE, - full_role_filter, - ["cn"], + role_filter_results = ldap_connection_role_filter.search_ext_s( + ",".join([user_ou, root_dn]), ldap.SCOPE_SUBTREE, full_role_filter, ["cn"], sizelimit=0 ) except Exception as e: log.exception("Failed to search for roles")