Files
edx-platform/openedx/core/lib/license/wrapper.py
2021-11-09 14:03:54 +10:30

15 lines
475 B
Python

"""
Code to wrap web fragments with a license.
"""
def wrap_with_license(block, view, frag, context, mako_service): # pylint: disable=unused-argument
"""
In the LMS, display the custom license underneath the XBlock.
"""
license = getattr(block, "license", None) # pylint: disable=redefined-builtin
if license:
context = {"license": license}
frag.content += mako_service.render_template('license_wrapper.html', context)
return frag