Skip to content

Commit b9e6022

Browse files
committed
CH-21 fix JupyerHub dependency on accounts
1 parent 8db3c26 commit b9e6022

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

libraries/cloudharness-common/cloudharness/auth/user_attributes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import re
21
from keycloak import KeycloakError
32
from .keycloak import AuthClient
4-
from cloudharness.applications import get_current_configuration
5-
from cloudharness_model.models import ApplicationConfig
3+
from cloudharness.auth.exceptions import AuthSecretNotFound
64
from cloudharness import log
75

86

@@ -123,7 +121,7 @@ def get_user_attributes(user_id: str = None, valid_keys={}, default_attributes={
123121
if not user_id:
124122
user_id = auth_client.get_current_user()["id"]
125123
user = auth_client.get_user(user_id, with_details=True)
126-
except KeycloakError as e:
124+
except (KeycloakError, AuthSecretNotFound) as e:
127125
log.warning("Quotas not available: error retrieving user: %s", user_id)
128126
raise UserNotFound("User not found") from e
129127

0 commit comments

Comments
 (0)