From cfd3a1cf1ac565c417267c1cbc296c1784032ec4 Mon Sep 17 00:00:00 2001 From: Jordan Milne Date: Fri, 9 Jan 2015 20:20:53 -0400 Subject: [PATCH] Check if `thing.childlisting` is falsy before including it This fixes bold `False`s showing up in the `.json-html` and `.json-compact` renderstyles. Apparently been an issue for 5 years, but it was only noticed now. --- r2/r2/templates/comment.compact | 5 ++++- r2/r2/templates/comment.html | 2 ++ r2/r2/templates/message.compact | 4 +++- r2/r2/templates/printable.html | 4 +++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/r2/r2/templates/comment.compact b/r2/r2/templates/comment.compact index 68c38f867..8eda0c90e 100644 --- a/r2/r2/templates/comment.compact +++ b/r2/r2/templates/comment.compact @@ -107,5 +107,8 @@ %else:
%endif - ${thing.childlisting}
+ %if thing.childlisting: + ${thing.childlisting} + %endif + diff --git a/r2/r2/templates/comment.html b/r2/r2/templates/comment.html index 39b97041b..ab160d389 100644 --- a/r2/r2/templates/comment.html +++ b/r2/r2/templates/comment.html @@ -129,7 +129,9 @@ ${parent.midcol(cls = cls)} %else:
%endif + %if thing.childlisting: ${thing.childlisting} + %endif
diff --git a/r2/r2/templates/message.compact b/r2/r2/templates/message.compact index 5dccbd651..f3559ec02 100644 --- a/r2/r2/templates/message.compact +++ b/r2/r2/templates/message.compact @@ -95,7 +95,9 @@
- ${thing.childlisting} + %if thing.childlisting: + ${thing.childlisting} + %endif
diff --git a/r2/r2/templates/printable.html b/r2/r2/templates/printable.html index 6a8180c30..b15412551 100644 --- a/r2/r2/templates/printable.html +++ b/r2/r2/templates/printable.html @@ -190,7 +190,9 @@ ${self.RenderPrintable()} <%def name="Child(display=True)">
- ${thing.childlisting} + %if thing.childlisting: + ${thing.childlisting} + %endif