From 420381c8a3a6119cc1d939d27f260677bd9b168f Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Sat, 10 Jan 2026 16:35:32 +0100 Subject: [PATCH] Deduped commitfest sidebar entries by patch, so if the patch link is identical we only show the latest commitfest entry Signed-off-by: Kai Wagner --- app/controllers/topics_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index e3066fc..963eecd 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -719,7 +719,9 @@ def load_commitfest_sidebar .where(commitfest_patch_topics: { topic_id: @topic.id }) .order("commitfests.end_date DESC, commitfests.start_date DESC") - @commitfest_sidebar_entries = entries.map do |entry| + deduped_entries = entries.uniq { |entry| entry.commitfest_patch.external_id } + + @commitfest_sidebar_entries = deduped_entries.map do |entry| patch = entry.commitfest_patch { commitfest_name: entry.commitfest.name, @@ -731,10 +733,10 @@ def load_commitfest_sidebar } end - reviewers = entries.flat_map { |entry| Topic.parse_csv_list(entry.commitfest_patch.reviewers) } + reviewers = deduped_entries.flat_map { |entry| Topic.parse_csv_list(entry.commitfest_patch.reviewers) } @commitfest_reviewers = reviewers.uniq - committers = entries.map { |entry| entry.commitfest_patch.committer.to_s.strip }.reject(&:blank?).uniq + committers = deduped_entries.map { |entry| entry.commitfest_patch.committer.to_s.strip }.reject(&:blank?).uniq @commitfest_committers = committers end