From 6d2464a3ea6be3fda88332da289b36a3eb81f157 Mon Sep 17 00:00:00 2001 From: Ben McMorran Date: Fri, 29 May 2015 21:00:56 +0000 Subject: [PATCH] fixup! Enable HTML in note tags and support highlighting --- lms/djangoapps/edxnotes/helpers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/edxnotes/helpers.py b/lms/djangoapps/edxnotes/helpers.py index 1b716223d8..30d70de7be 100644 --- a/lms/djangoapps/edxnotes/helpers.py +++ b/lms/djangoapps/edxnotes/helpers.py @@ -139,13 +139,14 @@ def preprocess_collection(user, course, collection): cache = {} with store.bulk_operations(course.id): for model in collection: - model.update({ + update = { u"text": sanitize_html(model["text"]), u"quote": sanitize_html(model["quote"]), u"updated": dateutil_parse(model["updated"]), - }) + } if "tags" in model: - model.update({u"tags": [sanitize_html(tag) for tag in model["tags"]]}) + update[u"tags"] = [sanitize_html(tag) for tag in model["tags"]] + model.update(update) usage_id = model["usage_id"] if usage_id in cache: model.update(cache[usage_id])