Skip to content

Commit

Permalink
Merge pull request #4401 from galaxyproject/risk-squeaker
Browse files Browse the repository at this point in the history
fix sending empty news
  • Loading branch information
bebatut authored Oct 9, 2023
2 parents 35045d8 + 0dbbfb3 commit afc517d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/news.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit afc517d

Please sign in to comment.