##// END OF EJS Templates
Fix some HTTP status codes in sessions API
Thomas Kluyver -
Show More
@@ -63,6 +63,7 b' class SessionRootHandler(IPythonHandler):'
63 63 kernel_id = km.start_kernel(cwd=nbm.notebook_dir)
64 64 model = sm.create_session(name=name, path=path, kernel_id=kernel_id, ws_url=self.ws_url)
65 65 self.set_header('Location', '{0}/api/sessions/{1}'.format(self.base_project_url, model['id']))
66 self.set_status(201)
66 67 self.finish(json.dumps(model, default=date_default))
67 68
68 69 class SessionHandler(IPythonHandler):
@@ -133,7 +133,7 b' class SessionManager(LoggingConfigurable):'
133 133 if reply is not None:
134 134 model = self.reply_to_dictionary_model(reply)
135 135 else:
136 model = None
136 raise web.HTTPError(404, u'Session not found: %s=%r' % (column, value))
137 137 return model
138 138
139 139 def update_session(self, session_id, **kwargs):
@@ -151,8 +151,6 b' class SessionManager(LoggingConfigurable):'
151 151 and the value replaces the current value in the session
152 152 with session_id.
153 153 """
154 column = kwargs.keys() # uses only the first kwarg that is entered
155 value = kwargs.values()
156 154 for kwarg in kwargs:
157 155 try:
158 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