Skip to content

Commit

Permalink
autoescape fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alzpeta committed Oct 18, 2023
1 parent ecaad47 commit 7a679d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion oarepo_ui/resources/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def _get_component_path(
f"Unable to find a file named {name}{file_ext} "
f"or one following the pattern {name_dot}*{file_ext}"
)

def _get_from_file(self, *, prefix: str, name: str, url_prefix: str, file_ext: str) -> "Component":
root_path, path = self._get_component_path(prefix, name, file_ext=file_ext)
component = Component(
Expand All @@ -87,7 +88,9 @@ def _get_from_file(self, *, prefix: str, name: str, url_prefix: str, file_ext: s
return component


def get_jinja_template(_catalog, template_def, fields=[]):
def get_jinja_template(_catalog, template_def, fields=None):
if fields is None:
fields = []
jinja_content = None
for component in _catalog.jinja_env.loader.searchpath:
if component["component_file"].endswith(template_def["layout"]):
Expand Down
4 changes: 2 additions & 2 deletions oarepo_ui/resources/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ def search(self):
)

search_config = partial(self.config.search_app_config, **search_options)

search_app_config = search_config(app_id=app_id)
json_data = json.dumps(search_app_config, default=lazy_string_encoder, indent=4)

return _catalog.render(
"search",
__source=source,
search_app_config=json_data,
search_app_config=search_app_config,
ui_config=self.config,
ui_resource=self,
layout=layout,
Expand Down

0 comments on commit 7a679d0

Please sign in to comment.