Skip to content

Commit

Permalink
Fix code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiaSliusar committed Jul 31, 2024
1 parent 9355a31 commit 2ee8b19
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def init_settings(
# default: set xsrf cookie on base_url
settings["xsrf_cookie_kwargs"] = {"path": base_url}
return settings

def page_config_hook(self, handler, page_config):
page_config["allow_custom_env_variables"] = self.allow_custom_env_variables
return page_config
Expand Down Expand Up @@ -1439,7 +1439,6 @@ def _default_allow_remote(self) -> bool:
help="""Allow to use custom env variables""",
)


browser = Unicode(
"",
config=True,
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/services/sessions/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ async def patch(self, session_id):
custom_env_vars = model["kernel"]["custom_env_vars"]
else:
custom_env_vars = {}

kernel_name = model["kernel"]["name"]
kernel_id = await sm.start_kernel_for_session(
session_id,
Expand Down
7 changes: 4 additions & 3 deletions jupyter_server/services/sessions/sessionmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ async def create_session(
record.kernel_id = kernel_id
self._pending_sessions.update(record)
result = await self.save_session(
session_id, path=path, name=name, type=type, kernel_id=kernel_id
session_id, path=path, name=name, type=type, kernel_id=kernel_id
)
self._pending_sessions.remove(record)
return cast(Dict[str, Any], result)
Expand Down Expand Up @@ -482,11 +482,12 @@ async def update_session(self, session_id, **kwargs):

# if we have custom env than we have to add them to available env variables
if self._custom_envs is not None and isinstance(self._custom_envs, dict):
if self._custom_envs[kernel_id] is not None and isinstance(self._custom_envs[kernel_id], dict):
if self._custom_envs[kernel_id] is not None and isinstance(
self._custom_envs[kernel_id], dict
):
for key, value in self._custom_envs[kernel_id].items():
env[key] = value


self.kernel_manager.update_env(kernel_id=kernel_id, env=env)

async def kernel_culled(self, kernel_id: str) -> bool:
Expand Down

0 comments on commit 2ee8b19

Please sign in to comment.