Skip to content

Commit 5b23b06

Browse files
committed
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 <[email protected]>
1 parent 543e5d2 commit 5b23b06

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/controllers/topics_controller.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,9 @@ def load_commitfest_sidebar
719719
.where(commitfest_patch_topics: { topic_id: @topic.id })
720720
.order("commitfests.end_date DESC, commitfests.start_date DESC")
721721

722-
@commitfest_sidebar_entries = entries.map do |entry|
722+
deduped_entries = entries.uniq { |entry| entry.commitfest_patch.external_id }
723+
724+
@commitfest_sidebar_entries = deduped_entries.map do |entry|
723725
patch = entry.commitfest_patch
724726
{
725727
commitfest_name: entry.commitfest.name,
@@ -731,10 +733,10 @@ def load_commitfest_sidebar
731733
}
732734
end
733735

734-
reviewers = entries.flat_map { |entry| Topic.parse_csv_list(entry.commitfest_patch.reviewers) }
736+
reviewers = deduped_entries.flat_map { |entry| Topic.parse_csv_list(entry.commitfest_patch.reviewers) }
735737
@commitfest_reviewers = reviewers.uniq
736738

737-
committers = entries.map { |entry| entry.commitfest_patch.committer.to_s.strip }.reject(&:blank?).uniq
739+
committers = deduped_entries.map { |entry| entry.commitfest_patch.committer.to_s.strip }.reject(&:blank?).uniq
738740
@commitfest_committers = committers
739741
end
740742

0 commit comments

Comments
 (0)