]> iEval git - gruntmaster-data.git/commitdiff
Simplify problem_list condition
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 3 Mar 2015 16:43:41 +0000 (18:43 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 3 Mar 2015 16:43:41 +0000 (18:43 +0200)
lib/Gruntmaster/Data.pm

index 75548fb18d4995ec63956b9dc029df387973c059..60ab3e53e4e1a94b6e042e7816cc93e8e1135ee9 100644 (file)
@@ -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;
This page took 0.017801 seconds and 4 git commands to generate.