From 8120459e4e56ef118d100b16b15f1afbc6e17487 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 24 Feb 2016 14:50:15 +0100 Subject: [PATCH] Backport PR #1127: Don't force save before download if notebook isn't writable closes #1112 --- notebook/static/notebook/js/menubar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebook/static/notebook/js/menubar.js b/notebook/static/notebook/js/menubar.js index 61d8e4524..921500094 100644 --- a/notebook/static/notebook/js/menubar.js +++ b/notebook/static/notebook/js/menubar.js @@ -79,7 +79,7 @@ define([ ) + "?download=" + download.toString(); var w = window.open('', IPython._target); - if (this.notebook.dirty) { + if (this.notebook.dirty && this.notebook.writable) { this.notebook.save_notebook().then(function() { w.location = url; }); @@ -122,7 +122,7 @@ define([ var url = utils.url_path_join( base_url, 'files', notebook_path ) + '?download=1'; - if (that.notebook.dirty) { + if (that.notebook.dirty && that.notebook.writable) { that.notebook.save_notebook().then(function() { w.location = url; });