From: Marius Gavrilescu Date: Fri, 16 Jan 2015 21:02:25 +0000 (+0200) Subject: Redirect to new job instead of job log on submit X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=31dc8096f3e0d6e54160401ce2b93489dec9d062;p=plack-app-gruntmaster.git Redirect to new job instead of job log on submit --- diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 1d8fc32..a809e46 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -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], []] } } }