From: Marius Gavrilescu Date: Wed, 9 Apr 2014 10:52:36 +0000 (+0300) Subject: Fix previous commit X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=97f8a42df152b4caf2c6cd58434556318fc450d1;p=plack-app-gruntmaster.git Fix previous commit --- diff --git a/app.psgi b/app.psgi index 6834f2b..750f57f 100644 --- a/app.psgi +++ b/app.psgi @@ -46,7 +46,10 @@ sub is_problem_private { sub is_problem_in_contest { my ($pb, $ct) = @_; return 1 if $db->contest_problems->find($ct, $pb); - return 1 unless defined $ct || $db->contest_problems->count({problem => $pb}); + return '' if defined $ct; + for my $cp ($db->problem($pb)->contest_problems) { + return 1 if $cp->contest->stop >= time; + } '' }