Skip to content

Commit

Permalink
Allow listing timeboards with empty descriptions (DataDog#385)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
Tenzer authored and David Bouchare committed Oct 25, 2019
1 parent 9299c14 commit 399b3ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datadog/dogshell/timeboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 399b3ce

Please sign in to comment.