From: Josh Williams Date: Fri, 4 Oct 2013 13:59:48 +0000 (-0400) Subject: Re-enable HTML santize, only run if 'html' present X-Git-Tag: release-20150131~386^2~76 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3cae2425012fa95fbcbdb23a7e7edbbfa6e55d57;p=oweals%2Fkarmaworld.git Re-enable HTML santize, only run if 'html' present --- 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()