From 3cae2425012fa95fbcbdb23a7e7edbbfa6e55d57 Mon Sep 17 00:00:00 2001 From: Josh Williams Date: Fri, 4 Oct 2013 09:59:48 -0400 Subject: [PATCH] Re-enable HTML santize, only run if 'html' present --- karmaworld/apps/notes/gdrive.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/karmaworld/apps/notes/gdrive.py b/karmaworld/apps/notes/gdrive.py index d84252e..ca5e62f 100644 --- a/karmaworld/apps/notes/gdrive.py +++ b/karmaworld/apps/notes/gdrive.py @@ -266,10 +266,10 @@ def convert_raw_document(raw_document): note.file_type = 'ppt' note.pdf_file.save(filename + '.pdf', ContentFile(content_dict['pdf'])) - else: - # PPT files do not have this export ability - note.gdrive_url = file_dict[u'exportLinks']['application/vnd.oasis.opendocument.text'] + elif 'html' in content_dict and content_dict['html']: note.html = content_dict['html'] + # before we save new html, sanitize a tags in note.html + note.sanitize_html(save=False) note.text = content_dict['text'] @@ -277,9 +277,6 @@ def convert_raw_document(raw_document): if 'year' in note_details and note_details['year']: note.year = note_details['year'] - # before we save new html, sanitize a tags in note.html - #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 note.save() -- 2.25.1