]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/Submit.pm
Make Gruntmaster::Page::Base::variants not need overriding
[gruntmaster-page.git] / lib / Gruntmaster / Page / Submit.pm
index 096af4d81a2e9092a545e73a13b34c7c36b1d730..2c9fef0c526cb8d869fd698bd4edbcc9e0abb42e 100644 (file)
@@ -27,14 +27,14 @@ sub generate{
        my ($problem, $format, $contest, $private, $prog) = map {scalar $r->param($_)} 'problem', 'prog_format', 'contest', 'private', 'source_code';
        my $upload = $r->upload('prog');
        if (defined $upload) {
-               my $temp = read_file $upload->filename;
+               my $temp = read_file $upload->path;
                $prog = $temp if $temp
        }
        die if defined $contest && $contest !~ /^\w+$/ ;
        die if defined $contest && (time > contest_end $contest);
        return reply 'A required parameter was not supplied' if grep { !defined } $problem, $format, $prog;
 
-       local $Gruntmaster::Data::contest = $contest;
+       local $Gruntmaster::Data::contest = $contest if $contest;
 
        my $job = push_job (
                date => time,
@@ -61,6 +61,4 @@ sub generate{
        [303, [Location => $r->path =~ s,/pb/\w+/submit$,/log/,r], ['']]
 }
 
-sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] }
-
 1
This page took 0.020345 seconds and 4 git commands to generate.