Skip to content

Commit

Permalink
Support jupyter-collaboration v3 (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski authored Oct 16, 2024
1 parent 6fdbecf commit bf52423
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/jupyter-ai/jupyter_ai/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,15 @@ def get_chat_user(self) -> ChatUser:
# (`serverapp` is a property on all `JupyterHandler` subclasses)
assert self.serverapp
extensions = self.serverapp.extension_manager.extensions
collaborative = (
collaborative_legacy = (
"jupyter_collaboration" in extensions
and extensions["jupyter_collaboration"].enabled
)
collaborative_v3 = (
"jupyter_server_ydoc" in extensions
and extensions["jupyter_server_ydoc"].enabled
)
collaborative = collaborative_legacy or collaborative_v3

if collaborative:
names = self.current_user.name.split(" ", maxsplit=2)
Expand Down

0 comments on commit bf52423

Please sign in to comment.