Skip to content

Commit

Permalink
Fix web_app settings accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Dec 3, 2024
1 parent 29f92d8 commit ed334de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/jupyter-ai/jupyter_ai/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class AiExtension(ExtensionApp):

def initialize(self):
super().initialize()
self.event_logger = self.settings["event_logger"]
self.event_logger = self.serverapp.web_app.settings["event_logger"]
self.event_logger.add_listener(
schema_id=JUPYTER_COLLABORATION_EVENTS_URI, listener=self.connect_chat
)
Expand Down Expand Up @@ -272,10 +272,10 @@ async def connect_chat(

async def get_chat(self, room_id: str) -> Optional[YChat]:
if COLLAB_VERSION == 3:
collaboration = self.settings["jupyter_server_ydoc"]
collaboration = self.serverapp.web_app.settings["jupyter_server_ydoc"]
document = await collaboration.get_document(room_id=room_id, copy=False)
else:
collaboration = self.settings["jupyter_collaboration"]
collaboration = self.serverapp.web_app.settings["jupyter_collaboration"]
server = collaboration.ywebsocket_server

room = await server.get_room(room_id)
Expand Down

0 comments on commit ed334de

Please sign in to comment.