Skip to content

Commit

Permalink
fix: jans-cli user list failing for empty customAttributes (#1525)
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar authored Jun 8, 2022
1 parent f7ce1b7 commit 7cbf10b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions jans-cli/cli/config_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,11 +1180,12 @@ def process_get(self, endpoint, return_value=False, parameters=None):
api_response_unmapped_ext = copy.deepcopy(api_response_unmapped)
if endpoint.info['operationId'] == 'get-user':
for entry in api_response_unmapped_ext:
for attrib in entry['customAttributes']:
if attrib['name'] == 'mail':
entry['mail'] = ', '.join(attrib['values'])
elif attrib['name'] in tabulate_endpoints[op_mode_endpoint]:
entry[attrib['name']] = attrib['values'][0]
if entry.get('customAttributes'):
for attrib in entry['customAttributes']:
if attrib['name'] == 'mail':
entry['mail'] = ', '.join(attrib['values'])
elif attrib['name'] in tabulate_endpoints[op_mode_endpoint]:
entry[attrib['name']] = attrib['values'][0]

tab_data = api_response_unmapped_ext
if op_mode_endpoint in tabular_dataset:
Expand Down

0 comments on commit 7cbf10b

Please sign in to comment.