From 7f4c490872d619cd186acf87a60921c40b828049 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 18 Nov 2020 22:15:32 +0000 Subject: [PATCH] Check item title earlier --- webapp_column_right.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/webapp_column_right.py b/webapp_column_right.py index b16357380..a1eb7e02c 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -205,6 +205,8 @@ def htmlNewswire(baseDir: str, newswire: {}, nickname: str, moderator: bool, separatorStr = htmlPostSeparator(baseDir, 'right') htmlStr = '' for dateStr, item in newswire.items(): + if not item[0].strip(): + continue publishedDate = \ datetime.strptime(dateStr, "%Y-%m-%d %H:%M:%S%z") dateShown = publishedDate.strftime("%Y-%m-%d %H:%M") @@ -221,10 +223,7 @@ def htmlNewswire(baseDir: str, newswire: {}, nickname: str, moderator: bool, totalVotesStr = \ votesIndicator(totalVotes, positiveVoting) - title = \ - removeLongWords(item[0], 16, []).replace('\n', '
').strip() - if not title: - continue + title = removeLongWords(item[0], 16, []).replace('\n', '
') htmlStr += '

' + \ '' + \ '' + title + \ @@ -250,10 +249,7 @@ def htmlNewswire(baseDir: str, newswire: {}, nickname: str, moderator: bool, totalVotesStr = \ votesIndicator(totalVotes, positiveVoting) - title = \ - removeLongWords(item[0], 16, []).replace('\n', '
').strip() - if not title: - continue + title = removeLongWords(item[0], 16, []).replace('\n', '
') if moderator and moderatedItem: htmlStr += '

' + \ '' + \ @@ -352,6 +348,8 @@ def htmlCitations(baseDir: str, nickname: str, domain: str, if newswire: ctr = 0 for dateStr, item in newswire.items(): + if not item[0].strip(): + continue # should this checkbox be selected? selectedStr = '' if dateStr in citationsSelected: