]> iEval git - gruntmaster-handlers.git/commitdiff
Add contest support and prevent some bugs
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 29 Jan 2014 13:03:45 +0000 (15:03 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 29 Jan 2014 13:03:45 +0000 (15:03 +0200)
lib/Gruntmaster/Handlers.pm

index 41ccfb45ef5d249539bcda8647ef2f5b21e8f844..7b6bddc6ca9b4bfe9dd613ddce204dfd7461fbf8 100644 (file)
@@ -52,6 +52,9 @@ sub submit{
   }
   die if defined $contest && $contest !~ /^\w+$/ ;
   die if defined $contest && (time < contest_start $contest || time > contest_end $contest);
+  return aputs 'A required parameter was not supplied' if grep { !defined } $problem, $format, $prog;
+
+  local $Gruntmaster::Data::contest = $contest;
 
   my $job = push_job (
          date => time,
@@ -73,7 +76,8 @@ sub submit{
          }
   };
 
-  PUBLISH 'jobs', $job;
+  $contest //= '';
+  PUBLISH 'jobs', "$contest.$job";
   $r->print("Job submitted");
   OK
 }
This page took 0.026526 seconds and 4 git commands to generate.