From a03339109f87ee27ba91af83e1ae0bbb3aa039a5 Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Tue, 2 Jul 2013 16:48:44 -0400 Subject: [PATCH] disabling Note.sanitize_html in gdrive processing as a workaround --- karmaworld/apps/notes/gdrive.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/karmaworld/apps/notes/gdrive.py b/karmaworld/apps/notes/gdrive.py index c12268d..a89ef7b 100644 --- a/karmaworld/apps/notes/gdrive.py +++ b/karmaworld/apps/notes/gdrive.py @@ -164,13 +164,12 @@ def convert_with_google_drive(note): content_dict = download_from_gdrive(file_dict, http, extension) - # Get a new copy of the file from the database with the new metadata from filemeta new_note = Note.objects.get(id=note.id) + if extension.lower() == '.pdf': new_note.file_type = 'pdf' - elif extension.lower() in ['.ppt', '.pptx']: new_note.file_type = 'ppt' now = datetime.datetime.utcnow() @@ -188,7 +187,6 @@ def convert_with_google_drive(note): _writer.write(content_dict['pdf']) _writer.close() - new_note.pdf_file = _path else: @@ -199,7 +197,8 @@ def convert_with_google_drive(note): new_note.text = content_dict['text'] # before we save new html, sanitize a tags in note.html - new_note.sanitize_html(save=False) + #new_note.sanitize_html(save=False) + #FIXME: ^^^ disabled until we can get html out of an Etree html element # Finally, save whatever data we got back from google new_note.save() -- 2.25.1