diff --git a/keep/api/routes/workflows.py b/keep/api/routes/workflows.py index d4acac775..ae8a837e0 100644 --- a/keep/api/routes/workflows.py +++ b/keep/api/routes/workflows.py @@ -187,7 +187,7 @@ def run_workflow( else: event_class = IncidentDto - event_body = body.get("body", {}) + event_body = body.get("body", {}) or body # if its event that was triggered by the UI with the Modal if "test-workflow" in event_body.get("fingerprint", "") or not body: diff --git a/keep/iohandler/iohandler.py b/keep/iohandler/iohandler.py index 244ad561f..ea7467582 100644 --- a/keep/iohandler/iohandler.py +++ b/keep/iohandler/iohandler.py @@ -1,5 +1,6 @@ import ast import copy +import html # TODO: fix this! It screws up the eval statement if these are not imported import inspect @@ -311,8 +312,6 @@ def _parse(self, tree): # this is happens when libraries such as datadog api client # HTML escapes the string and then ast.parse fails () # https://github.com/keephq/keep/issues/137 - import html - try: unescaped_token = html.unescape( token.replace("\r\n", "").replace("\n", "") @@ -376,6 +375,8 @@ def _render(self, key: str, safe=False, default=""): return default if const_rendering: + # https://github.com/keephq/keep/issues/2326 + rendered = html.unescape(rendered) return self._render(rendered, safe, default) return rendered diff --git a/pyproject.toml b/pyproject.toml index bfbb2421d..758f57d9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "keep" -version = "0.27.6" +version = "0.27.7" description = "Alerting. for developers, by developers." authors = ["Keep Alerting LTD"] readme = "README.md"