From 620c8a7d96e4c78860cb0b708ea3f6316daea700 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 27 Jan 2017 12:26:55 +0000 Subject: [PATCH] fix document creation --- pandora/document/models.py | 2 +- static/js/embedDocumentDialog.js | 2 +- static/js/textPanel.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/document/models.py b/pandora/document/models.py index ef2e491ec..78bc3f11b 100644 --- a/pandora/document/models.py +++ b/pandora/document/models.py @@ -600,7 +600,7 @@ class Document(models.Model): def update_linked_documents(self): if self.extension == 'html': old = [d.id for id in self.linked_documents.all()] - current = utils.get_documents(self.data['text']) + current = utils.get_documents(self.data.get('text', '')) removed = list(set(old) - set(current)) added = list(set(current) - set(old)) if removed: diff --git a/static/js/embedDocumentDialog.js b/static/js/embedDocumentDialog.js index 535636d0d..15423a056 100644 --- a/static/js/embedDocumentDialog.js +++ b/static/js/embedDocumentDialog.js @@ -18,7 +18,7 @@ pandora.ui.embedDocumentDialog = function(id, position) { marginTop: '8px' }) .val( - '' diff --git a/static/js/textPanel.js b/static/js/textPanel.js index fe3379311..d54ef918e 100644 --- a/static/js/textPanel.js +++ b/static/js/textPanel.js @@ -386,7 +386,7 @@ pandora.ui.textHTML = function(text) { ? pandora.user.ui.documents[pandora.user.ui.part.document] : pandora.user.ui.section == 'documents' ? pandora.user.ui.documents[pandora.user.ui.document] - : {}), + : {}) || {}, position = settings.position || 0, element, scrollTop;