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.
This commit is contained in:
Maxim Beder
2022-10-17 19:25:50 +02:00
committed by Maxim Beder
parent e0330cf418
commit 0919fc7dab

View File

@@ -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: