diff --git a/lms/djangoapps/django_comment_client/forum/views.py b/lms/djangoapps/django_comment_client/forum/views.py index 5b643f3920..6217de63e2 100644 --- a/lms/djangoapps/django_comment_client/forum/views.py +++ b/lms/djangoapps/django_comment_client/forum/views.py @@ -155,7 +155,7 @@ def render_single_thread(request, discussion_id, course_id, thread_id): context = { 'discussion_id': discussion_id, 'thread': thread, - 'user_info': cc.User.from_django_user(request.user).to_dict(), + 'user_info': json.dumps(cc.User.from_django_user(request.user).to_dict()), 'annotated_content_info': json.dumps(annotated_content_info), 'course_id': course_id, 'request': request, diff --git a/lms/templates/discussion/_forum.html b/lms/templates/discussion/_forum.html index 82cb15ad24..6ef21b6de7 100644 --- a/lms/templates/discussion/_forum.html +++ b/lms/templates/discussion/_forum.html @@ -1,4 +1,5 @@ <%namespace name="renderer" file="_thread.html"/> +<%! from django.template.defaultfilters import escapejs %>
@@ -29,10 +30,10 @@ %> diff --git a/lms/templates/discussion/_single_thread.html b/lms/templates/discussion/_single_thread.html index 8dd2b5e87f..3c92fd37b6 100644 --- a/lms/templates/discussion/_single_thread.html +++ b/lms/templates/discussion/_single_thread.html @@ -1,20 +1,16 @@ <%namespace name="renderer" file="_thread.html"/> +<%! from django.template.defaultfilters import escapejs %> -
+
Discussion ${renderer.render_thread(course_id, thread, show_comments=True)}
-<%! - def escape_quotes(text): - return text.replace('\"', '\\\"').replace("\'", "\\\'") -%> -