Skip to content

Commit

Permalink
app: handle configs that are not LazyConfigValue objects
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Jul 12, 2024
1 parent 212b269 commit c657db9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cylc/uiserver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
default,
validate,
)
from traitlets.config.loader import LazyConfigValue
from types import SimpleNamespace

from jupyter_server.extension.application import ExtensionApp
Expand Down Expand Up @@ -546,10 +547,17 @@ def set_auth(self) -> Authorization:
"""Create authorization object.
One for the lifetime of the UIServer.
"""
user_auth = self.config.CylcUIServer.user_authorization.to_dict()
site_auth = self.config.CylcUIServer.site_authorization.to_dict()
if isinstance(user_auth, LazyConfigValue):
user_auth: dict = user_auth.to_dict()
if isinstance(site_auth, LazyConfigValue):
site_auth: dict = site_auth.to_dict()

return Authorization(
getpass.getuser(),
self.config.CylcUIServer.user_authorization.to_dict(),
self.config.CylcUIServer.site_authorization.to_dict(),
user_auth,
site_auth,
self.log,
)

Expand Down

0 comments on commit c657db9

Please sign in to comment.