X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=app.psgi;h=750f57fddf819037c05d8143e2a2fe8a21eb5f54;hb=97f8a42df152b4caf2c6cd58434556318fc450d1;hp=6834f2b45fe9a6e64d6a9b108a2dcf62deee3baa;hpb=e46ca532282195bf45d3e300b589c7ecee05c55f;p=gruntmaster-page.git 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; + } '' }