From: Seth Woodworth Date: Tue, 2 Jul 2013 20:48:44 +0000 (-0400) Subject: disabling Note.sanitize_html in gdrive processing as a workaround X-Git-Tag: release-20150131~401 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a03339109f87ee27ba91af83e1ae0bbb3aa039a5;p=oweals%2Fkarmaworld.git disabling Note.sanitize_html in gdrive processing as a workaround --- 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()