Skip to content

Commit 8934533

Browse files
committed
Add in small check for data not found on get service account by client name
1 parent 4bf2df7 commit 8934533

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

auth-api/src/auth_api/services/keycloak.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ def get_service_account_by_client_name(client_name: str):
461461
timeout=timeout,
462462
)
463463
response.raise_for_status()
464+
if len(response.json()) == 0:
465+
raise BusinessException(Error.DATA_NOT_FOUND, None)
464466
client_id = response.json()[0]["id"]
465467
return KeycloakService.get_service_account_user(client_id)
466468

0 commit comments

Comments
 (0)