]> iEval git - gruntmaster-data.git/commitdiff
Do not restrict job_list by contest
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 6 Feb 2015 08:37:11 +0000 (10:37 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 6 Feb 2015 08:37:11 +0000 (10:37 +0200)
lib/Gruntmaster/Data.pm

index 00eeaf27371d73b701e1722a5c95b67d4a1d74d8..344885deb3dd7f2489f12950d9453677c032a6ad 100644 (file)
@@ -138,7 +138,8 @@ sub contest_entry {
 sub job_list {
        my ($self, %args) = @_;
        $args{page} //= 1;
-       my $rs = $self->jobs->search({contest => $args{contest}}, {order_by => {-desc => 'me.id'}, prefetch => ['problem', 'owner'], rows => JOBS_PER_PAGE, page => $args{page}});
+       my $rs = $self->jobs->search(undef, {order_by => {-desc => 'me.id'}, prefetch => ['problem', 'owner'], rows => JOBS_PER_PAGE, page => $args{page}});
+       $rs = $rs->search({contest => $args{contest} || undef}) if exists $args{contest};
        $rs = $rs->search({'me.private'=> 0})          unless $args{private};
        $rs = $rs->search({'me.owner'  => $args{owner}})   if $args{owner};
        $rs = $rs->search({problem     => $args{problem}}) if $args{problem};
This page took 0.029915 seconds and 4 git commands to generate.