From: Marius Gavrilescu Date: Tue, 3 Mar 2015 14:44:05 +0000 (+0200) Subject: Set contest on problem_list only when contest is running X-Git-Tag: 5999.000_014~65 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=e340417cb98eddc0733c11405485602bf4c85c2e;p=gruntmaster-data.git Set contest on problem_list only when contest is running --- diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index b4a124c..75548fb 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -83,7 +83,7 @@ sub problem_list { $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; - $params{contest} = $args{contest} if $args{contest}; + $params{contest} = $args{contest} if $args{contest} && $self->contest($args{contest})->is_running; for ($rs->all) { $params{$_->level} //= []; push @{$params{$_->level}}, {$_->get_columns, owner_name => $_->owner->name} ;