From 0dbbfb33e98b7c4867bb259200cf871f5349eb4b Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Mon, 9 Oct 2023 13:49:47 +0200 Subject: [PATCH] fix sending empty news --- bin/news.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/news.rb b/bin/news.rb index 608544d4f070e6..589adc2fa054a8 100755 --- a/bin/news.rb +++ b/bin/news.rb @@ -149,7 +149,7 @@ def build_news(data, filter: nil) if filter.nil? output += format_news(data[:added][:news]) - newsworthy = newsworthy | format_news(data[:added][:news]).length + newsworthy = newsworthy | format_news(data[:added][:news]).length.positive? end o = format_tutorials( @@ -158,14 +158,14 @@ def build_news(data, filter: nil) ) output += o - newsworthy = newsworthy | o.length + newsworthy = newsworthy | o.length.positive? o = format_tutorials( data[:added][:slides].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ }, data[:modified][:slides].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ } ) output += o - newsworthy = newsworthy | o.length + newsworthy = newsworthy | o.length.positive? if filter.nil? && data[:contributors].length.positive? newsworthy = true