Skip to content

Commit

Permalink
drop monkeypatch component
Browse files Browse the repository at this point in the history
  • Loading branch information
mirekys committed Nov 3, 2023
1 parent 18d913a commit e6ee6f1
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions oarepo_ui/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,6 @@ def catalog(self):
return self._catalog_config(self._catalog, self.templates.jinja_env)

def _catalog_config(self, catalog, env):

# monkeypatch component - see https://github.com/jpsca/jinjax/issues/32
from markupsafe import Markup
from jinjax.component import Component

def render(self, **kwargs):
assert self.tmpl, f"Component {self.name} has no template"
return Markup(self.tmpl.render(**kwargs).strip())
render.__name__ = 'render_patched_by_oarepo_ui'
Component.render = render
# monkeypatch end

context = {}
env.policies.setdefault("json.dumps_kwargs", {}).setdefault("default", str)
self.app.update_template_context(context)
Expand Down

0 comments on commit e6ee6f1

Please sign in to comment.