From 399b3cede440a548f7be15039ae8b682b3b9a2f0 Mon Sep 17 00:00:00 2001 From: Jeppe Fihl-Pearson Date: Tue, 4 Jun 2019 14:11:53 +0100 Subject: [PATCH] Allow listing timeboards with empty descriptions (#385) The `_escape()` method assumed it always would be receiving a string, but if there is no description set on a timeboard it would instead be set to `None`. This handles those cases by instead making the function return an empty string in case the input is False-y - ie. `None`. --- datadog/dogshell/timeboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog/dogshell/timeboard.py b/datadog/dogshell/timeboard.py index 457c86961..2e37bfc24 100644 --- a/datadog/dogshell/timeboard.py +++ b/datadog/dogshell/timeboard.py @@ -320,7 +320,7 @@ def _web_view(cls, args): @classmethod def _escape(cls, s): - return s.replace("\r", "\\r").replace("\n", "\\n").replace("\t", "\\t") + return s.replace("\r", "\\r").replace("\n", "\\n").replace("\t", "\\t") if s else "" def _template_variables(tpl_var_input):