Always use filename as the notebook name.

This commit is contained in:
Brian Granger 2012-05-31 14:01:36 -07:00
parent 9af0496692
commit 09da6cb8af

View File

@ -151,8 +151,8 @@ class NotebookManager(LoggingConfigurable):
nb = current.reads(s, u'json') nb = current.reads(s, u'json')
except: except:
raise web.HTTPError(500, u'Unreadable JSON notebook.') raise web.HTTPError(500, u'Unreadable JSON notebook.')
if 'name' not in nb: # Always use the filename as the notebook name.
nb.name = os.path.split(path)[-1].split(u'.')[0] nb.metadata.name = os.path.split(path)[-1].split(u'.')[0]
return last_modified, nb return last_modified, nb
def save_new_notebook(self, data, name=None, format=u'json'): def save_new_notebook(self, data, name=None, format=u'json'):