Skip to content

Commit d7c5ddd

Browse files

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

readthedocs/notifications/messages.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,18 @@ def _escape_format_values(self, format_values):
4646
If we want to support other types or nested dictionaries,
4747
we will need to iterate recursively to apply the ``escape`` function.
4848
"""
49-
return {
49+
result = {
5050
key: escape(value)
5151
for key, value in format_values.items()
5252
if isinstance(value, (str, int))
5353
}
5454

55+
# TODO: improve this code; I need to hotfix it for now.
56+
# We need to keep passing the "instance" that comes from the notification object itself.
57+
if "instance" in format_values:
58+
result["instance"] = format_values["instance"]
59+
return result
60+
5561
def set_format_values(self, format_values):
5662
self.format_values = self._escape_format_values(format_values)
5763

0 commit comments

Comments
 (0)