##// END OF EJS Templates
Merge pull request #4427 from minrk/checkpoint-on-first-save...
Min RK -
r13325:5df7a44d merge
parent child Browse files
Show More
@@ -222,6 +222,10 b' class FileNotebookManager(NotebookManager):'
222 222
223 223 if 'content' not in model:
224 224 raise web.HTTPError(400, u'No notebook JSON data provided')
225
226 # One checkpoint should always exist
227 if self.notebook_exists(name, path) and not self.list_checkpoints(name, path):
228 self.create_checkpoint(name, path)
225 229
226 230 new_path = model.get('path', path).strip('/')
227 231 new_name = model.get('name', name)
@@ -326,8 +330,9 b' class FileNotebookManager(NotebookManager):'
326 330 def get_checkpoint_path(self, checkpoint_id, name, path=''):
327 331 """find the path to a checkpoint"""
328 332 path = path.strip('/')
333 basename, _ = os.path.splitext(name)
329 334 filename = u"{name}-{checkpoint_id}{ext}".format(
330 name=name,
335 name=basename,
331 336 checkpoint_id=checkpoint_id,
332 337 ext=self.filename_ext,
333 338 )
@@ -117,7 +117,7 b' class NotebookManager(LoggingConfigurable):'
117 117 raise NotImplementedError('must be implemented in a subclass')
118 118
119 119 def create_notebook_model(self, model=None, path=''):
120 """Create a new untitled notebook and return its model with no content."""
120 """Create a new notebook and return its model with no content."""
121 121 path = path.strip('/')
122 122 if model is None:
123 123 model = {}
General Comments 0
You need to be logged in to leave comments. Login now