From 2fdef0a7047033bcd2954af1020ff3a99493cd82 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 29 Jan 2014 15:03:45 +0200 Subject: [PATCH] Add contest support and prevent some bugs --- lib/Gruntmaster/Handlers.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Gruntmaster/Handlers.pm b/lib/Gruntmaster/Handlers.pm index 41ccfb4..7b6bddc 100644 --- a/lib/Gruntmaster/Handlers.pm +++ b/lib/Gruntmaster/Handlers.pm @@ -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 } -- 2.39.2