Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions common/lib/xmodule/xmodule/html_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ def student_view_data(self, context=None): # pylint: disable=unused-argument

def get_html(self):
""" Returns html required for rendering the block. """
if self.data is not None and getattr(self.system, 'anonymous_student_id', None) is not None:
return self.data.replace("%%USER_ID%%", self.system.anonymous_student_id)
return self.data
return get_html(self)

def studio_view(self, _context):
"""
Expand Down Expand Up @@ -368,6 +366,15 @@ def index_dictionary(self):
return xblock_body


def get_html(block: HtmlBlock):
"""
Common function to get html content from an HtmlBlock.
"""
if block.data is not None and getattr(block.system, 'anonymous_student_id', None) is not None:
return block.data.replace("%%USER_ID%%", block.system.anonymous_student_id)
return block.data


class AboutFields(object):
display_name = String(
help=_("The display name for this component."),
Expand All @@ -389,6 +396,14 @@ class AboutBlock(AboutFields, HtmlBlock):
"""
template_dir_name = "about"

def get_html(self):
"""
Returns html required for rendering the block.
This is required because HtmlBlock.get_html is overridden with the edxnotes,
and we don't want edxnotes injected into the about course sections.
"""
return get_html(self)


class StaticTabFields(object):
"""
Expand Down