Skip to content

Commit 91953d0

Browse files
committed
fix(ext_jinja2): refactor hard-coded reference to jinja2 template handler
Issue: #749
1 parent d8bd90b commit 91953d0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
Bugs:
66

7-
- None
7+
- `[ext_jinja2]` Refactor hard-coded reference to `jinja2` template handler.
8+
- [Issue #749](https://github.com/datafolklabs/cement/issues/749)
89

910
Features:
1011

cement/ext/ext_jinja2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class Jinja2OutputHandler(OutputHandler):
3434
Please see the developer documentation on
3535
:cement:`Output Handling <dev/output>`.
3636
37+
This class has an assumed depency on it's associated Jinja2TemplateHandler.
38+
If sub-classing, you must also sub-class/implement the Jinja2TemplateHandler
39+
and give it the same label.
3740
"""
3841

3942
class Meta(OutputHandler.Meta):
@@ -48,7 +51,7 @@ def __init__(self, *args: Any, **kw: Any) -> None:
4851

4952
def _setup(self, app: App) -> None:
5053
super(Jinja2OutputHandler, self)._setup(app)
51-
self.templater = self.app.handler.resolve('template', 'jinja2', setup=True) # type: ignore
54+
self.templater = self.app.handler.resolve('template', self._meta.label, setup=True) # type: ignore
5255

5356
def render(self, data: Dict[str, Any], template: str = None, **kw: Any) -> str: # type: ignore
5457
"""

0 commit comments

Comments
 (0)