in src/services/user_service.py [0:0]
def list_users(self, customer=None, attributes_to_get=None):
response = self.client.list_users(
attributes_to_get=attributes_to_get)
if not response or 'Users' not in response:
return
users = response['Users']
if not customer:
return users
filtered_users = []
for user in users:
attributes = user.get('Attributes')
user_customer = [i['Value'] for i in attributes if i['Name'] ==
CUSTOM_CUSTOMER_ATTR]
if not user_customer or len(user_customer) != 1:
continue
if user_customer[0] == customer:
filtered_users.append(user)
return filtered_users