Skip to content

Commit

Permalink
Merge pull request #35033 from edly-io/maq/#33589
Browse files Browse the repository at this point in the history
33589: Updated mako_block.py to use MakoService
  • Loading branch information
feanil authored Oct 1, 2024
2 parents fd9ddea + 929df12 commit 7443368
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions xmodule/mako_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ class MakoTemplateBlockBase:

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if getattr(self.runtime, 'render_template', None) is None:
raise TypeError(
'{runtime} must have a render_template function'
' in order to use a MakoDescriptor'.format(
runtime=self.runtime,
)
)

def get_context(self):
"""
Expand All @@ -69,7 +62,7 @@ def studio_view(self, context): # pylint: disable=unused-argument
"""
# pylint: disable=no-member
fragment = Fragment(
self.runtime.render_template(self.mako_template, self.get_context())
self.runtime.service(self, 'mako').render_template(self.mako_template, self.get_context())
)
shim_xmodule_js(fragment, self.js_module_name)
return fragment

0 comments on commit 7443368

Please sign in to comment.