From 0919fc7dabede63137749959dc84eb6d3c70a86f Mon Sep 17 00:00:00 2001 From: Maxim Beder Date: Mon, 17 Oct 2022 19:25:50 +0200 Subject: [PATCH] refactor: add js_module_name attribute to MakoTemplateBlockBase In the previous commit `js_module_name = None` was removed from HTMLSnippet class, because it's not being used by this class, or the classes that inherit from it. But `js_module_name` is used in MakoTemplateBlockBase. Not all classes that inherit from MakoTemplateBlockBase define this attribute, since the same classes inherit from HTMLSnippet class, which used to provide a fallback for this attribute. To prevent `AttributeError`, defining the default value of `None` in MakoTemplateBlockBase. --- xmodule/mako_module.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmodule/mako_module.py b/xmodule/mako_module.py index 238d7d7449..977aac2260 100644 --- a/xmodule/mako_module.py +++ b/xmodule/mako_module.py @@ -41,6 +41,8 @@ class MakoTemplateBlockBase: """ # pylint: disable=no-member + js_module_name = None + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if getattr(self.runtime, 'render_template', None) is None: