Show More
@@ -63,6 +63,7 b' class SessionRootHandler(IPythonHandler):' | |||||
63 | kernel_id = km.start_kernel(cwd=nbm.notebook_dir) |
|
63 | kernel_id = km.start_kernel(cwd=nbm.notebook_dir) | |
64 | model = sm.create_session(name=name, path=path, kernel_id=kernel_id, ws_url=self.ws_url) |
|
64 | model = sm.create_session(name=name, path=path, kernel_id=kernel_id, ws_url=self.ws_url) | |
65 | self.set_header('Location', '{0}/api/sessions/{1}'.format(self.base_project_url, model['id'])) |
|
65 | self.set_header('Location', '{0}/api/sessions/{1}'.format(self.base_project_url, model['id'])) | |
|
66 | self.set_status(201) | |||
66 | self.finish(json.dumps(model, default=date_default)) |
|
67 | self.finish(json.dumps(model, default=date_default)) | |
67 |
|
68 | |||
68 | class SessionHandler(IPythonHandler): |
|
69 | class SessionHandler(IPythonHandler): |
@@ -133,7 +133,7 b' class SessionManager(LoggingConfigurable):' | |||||
133 | if reply is not None: |
|
133 | if reply is not None: | |
134 | model = self.reply_to_dictionary_model(reply) |
|
134 | model = self.reply_to_dictionary_model(reply) | |
135 | else: |
|
135 | else: | |
136 | model = None |
|
136 | raise web.HTTPError(404, u'Session not found: %s=%r' % (column, value)) | |
137 | return model |
|
137 | return model | |
138 |
|
138 | |||
139 | def update_session(self, session_id, **kwargs): |
|
139 | def update_session(self, session_id, **kwargs): | |
@@ -151,8 +151,6 b' class SessionManager(LoggingConfigurable):' | |||||
151 | and the value replaces the current value in the session |
|
151 | and the value replaces the current value in the session | |
152 | with session_id. |
|
152 | with session_id. | |
153 | """ |
|
153 | """ | |
154 | column = kwargs.keys() # uses only the first kwarg that is entered |
|
|||
155 | value = kwargs.values() |
|
|||
156 | for kwarg in kwargs: |
|
154 | for kwarg in kwargs: | |
157 | try: |
|
155 | try: | |
158 | self.cursor.execute("UPDATE session SET %s=? WHERE id=?" %kwarg, (kwargs[kwarg], session_id)) |
|
156 | self.cursor.execute("UPDATE session SET %s=? WHERE id=?" %kwarg, (kwargs[kwarg], session_id)) |
General Comments 0
You need to be logged in to leave comments.
Login now