Skip to content

Commit

Permalink
21953 Fix issue when auth returns empty contacts list for GET <auth_u…
Browse files Browse the repository at this point in the history
…rl>/entities/{identifier} endpoint (bcgov#2839)
  • Loading branch information
argush3 authored Jul 17, 2024
1 parent fd438a7 commit 313c5a4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def _get_email_address_from_auth(identifier: str):
f'{current_app.config.get("AUTH_URL")}/entities/{identifier}',
headers=headers
)
contacts = contact_info.json()['contacts']
contacts = contact_info.json().get('contacts', [])
if not contacts or not contacts[0]['email']:
return None
return contacts[0]['email']
Expand Down

0 comments on commit 313c5a4

Please sign in to comment.