def _run_ldap_query(query, limit): users = LdapService.search_users(query, limit) """Converts the user models into something akin to the LookupModel in models/file.py, so this can be returned in the same way we return a lookup data model.""" user_list = [] for user in users: user_list.append({ "value": user['uid'], "label": user['display_name'] + " (" + user['uid'] + ")", "data": user }) return user_list
def _run_ldap_query(query, value, limit): if value: return [LdapSchema().dump(LdapService.user_info(value))] else: users = LdapService.search_users(query, limit) return users