From 97f8a42df152b4caf2c6cd58434556318fc450d1 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 9 Apr 2014 13:52:36 +0300 Subject: [PATCH] Fix previous commit --- app.psgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; + } '' } -- 2.30.2