From 31dc8096f3e0d6e54160401ce2b93489dec9d062 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 16 Jan 2015 23:02:25 +0200 Subject: [PATCH] Redirect to new job instead of job log on submit --- lib/Plack/App/Gruntmaster.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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], []] } } } -- 2.39.2