From: Marius Gavrilescu Date: Tue, 25 Mar 2014 08:51:59 +0000 (+0200) Subject: Add distinct => 1 to problem list X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=0a329295bb764112812177386b525ed3aa2b8c6d;p=plack-app-gruntmaster.git Add distinct => 1 to problem list --- 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} };