Skip to content

Commit

Permalink
Allow listing timeboards with empty descriptions (#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 zippolyte committed Jun 4, 2019
1 parent 0c1365d commit 90cfb20
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 90cfb20

Please sign in to comment.