From aadc8d86ba8ea467a93d13f8574e4cf708e40ca9 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Tue, 3 Mar 2015 18:43:41 +0200 Subject: [PATCH] Simplify problem_list condition --- lib/Gruntmaster/Data.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index 75548fb..60ab3e5 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -79,7 +79,7 @@ sub problem_list { my @columns = @{PROBLEM_PUBLIC_COLUMNS()}; push @columns, 'solution' if $args{solution} && $args{contest} && !$self->contest($args{contest})->is_running; my $rs = $self->problems->search(undef, {order_by => 'me.name', columns => \@columns, prefetch => 'owner'}); - $rs = $rs->search({-or => ['contest_problems.contest' => undef, 'contest.stop' => {'<=', time}], 'me.private' => 0}, {join => {'contest_problems' => 'contest'}, distinct => 1}) unless $args{contest} || $args{private}; + $rs = $rs->search({'private' => 0}) unless $args{contest} || $args{private}; $rs = $rs->search({'contest_problems.contest' => $args{contest}}, {join => 'contest_problems'}) if $args{contest}; $rs = $rs->search({'me.owner' => $args{owner}}) if $args{owner}; my %params; -- 2.39.2