From 9d16980e723cb9ca5068e87cb19d6554698498d5 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 6 Feb 2015 10:37:11 +0200 Subject: [PATCH] Do not restrict job_list by contest --- lib/Gruntmaster/Data.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index 00eeaf2..344885d 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -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}; -- 2.39.2