Skip to content

Commit

Permalink
Add back the overrides loading at handler level as a fallback
Browse files Browse the repository at this point in the history
To make the change non-breaking in case if other apps
used this handler which is a part of the public API
  • Loading branch information
krassowski committed May 22, 2024
1 parent 1ea2d53 commit 16762f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jupyterlab_server/settings_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize( # type:ignore[override]
schemas_dir: str,
settings_dir: str,
labextensions_path: list[str],
overrides: dict[str, Any],
overrides: dict[str, Any] | None = None,
**kwargs: Any, # noqa: ARG002
) -> None:
"""Initialize the handler."""
Expand Down
9 changes: 8 additions & 1 deletion jupyterlab_server/settings_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,17 +448,24 @@ def initialize(
schemas_dir: str,
settings_dir: str,
labextensions_path: list[str] | None,
overrides: dict[str, Any],
overrides: dict[str, Any] | None = None,
**kwargs: Any,
) -> None:
"""Initialize the handler."""
super().initialize(**kwargs)
error = None
if not overrides:
overrides, error = _get_overrides(app_settings_dir)
self.overrides = overrides
self.app_settings_dir = app_settings_dir
self.schemas_dir = schemas_dir
self.settings_dir = settings_dir
self.labextensions_path = labextensions_path

if error:
overrides_warning = "Failed loading overrides: %s"
self.log.warning(overrides_warning, error)

def get_current_locale(self) -> str:
"""
Get the current locale as specified in the translation-extension settings.
Expand Down

0 comments on commit 16762f2

Please sign in to comment.