]> iEval git - plack-app-gruntmaster.git/commitdiff
Redirect to new job instead of job log on submit
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 16 Jan 2015 21:02:25 +0000 (23:02 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 16 Jan 2015 21:02:25 +0000 (23:02 +0200)
lib/Plack/App/Gruntmaster.pm

index 1d8fc325e032d885fff24f672a0dd0274d829287..a809e4669863bc3d77bf4b17cfec39fd9680650e 100644 (file)
@@ -216,7 +216,7 @@ sub dispatch_request{
 
                        my $source = $prog ? read_file $prog->path : $_{source_code};
                        unlink $prog->path if $prog;
-                       db->jobs->create({
+                       my $newjob = db->jobs->create({
                                maybe contest => $_{contest},
                                maybe private => problem->private,
                                date => time,
@@ -228,7 +228,7 @@ sub dispatch_request{
                        });
 
                        purge '/log/';
-                       redirect $_{contest} ? "/log/?contest=$_{contest}" : '/log/';
+                       [303, [Location => '/log/' . $newjob->id], []]
                }
        }
 }
This page took 0.028396 seconds and 4 git commands to generate.