diff --git a/readthedocs/notifications/messages.py b/readthedocs/notifications/messages.py index 6fef2648e9f..a4e7b9cfd05 100644 --- a/readthedocs/notifications/messages.py +++ b/readthedocs/notifications/messages.py @@ -46,12 +46,18 @@ def _escape_format_values(self, format_values): If we want to support other types or nested dictionaries, we will need to iterate recursively to apply the ``escape`` function. """ - return { + result = { key: escape(value) for key, value in format_values.items() if isinstance(value, (str, int)) } + # TODO: improve this code; I need to hotfix it for now. + # We need to keep passing the "instance" that comes from the notification object itself. + if "instance" in format_values: + result["instance"] = format_values["instance"] + return result + def set_format_values(self, format_values): self.format_values = self._escape_format_values(format_values)