From 0a329295bb764112812177386b525ed3aa2b8c6d Mon Sep 17 00:00:00 2001
From: Marius Gavrilescu <marius@ieval.ro>
Date: Tue, 25 Mar 2014 10:51:59 +0200
Subject: [PATCH] Add distinct => 1 to problem list

---
 lib/Gruntmaster/Page/Generic.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Gruntmaster/Page/Generic.pm b/lib/Gruntmaster/Page/Generic.pm
index 35d89ad..9e07d4c 100644
--- a/lib/Gruntmaster/Page/Generic.pm
+++ b/lib/Gruntmaster/Page/Generic.pm
@@ -123,7 +123,7 @@ thing {
 		my $db = db $env;
 		return $db->problems->search({owner => $env->{'gruntmaster.user'}}) if exists $env->{'gruntmaster.user'};
 		return $db->problems->search({'contest_problems.contest' => $env->{'gruntmaster.contest'}}, {join => 'contest_problems'}) if exists $env->{'gruntmaster.contest'};
-		$db->problems->search({-or => ['contest_problems.contest' => undef, 'contest.stop' => {'<=', time}], 'me.private' => 0}, {join => {'contest_problems' => 'contest'}});
+		$db->problems->search({-or => ['contest_problems.contest' => undef, 'contest.stop' => {'<=', time}], 'me.private' => 0}, {join => {'contest_problems' => 'contest'}, distinct => 1});
 	};
 	sortby { $a->{name} cmp $b->{name}};
 	group { $_->{level} };
-- 
2.39.5