Fix previous commit
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 9 Apr 2014 10:52:36 +0000 (13:52 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 9 Apr 2014 10:52:36 +0000 (13:52 +0300)
app.psgi

index 6834f2b45fe9a6e64d6a9b108a2dcf62deee3baa..750f57fddf819037c05d8143e2a2fe8a21eb5f54 100644 (file)
--- 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;
+       }
        ''
 }
 
This page took 0.010983 seconds and 4 git commands to generate.