]> iEval git - gruntmaster-page.git/blobdiff - lib/Plack/App/Gruntmaster.pm
Merge branch 'master' into newmc
[gruntmaster-page.git] / lib / Plack / App / Gruntmaster.pm
index 2bacc0a05a537d2d0202be8642ac824cea05970a..aa473d866c1376d349c722c053329af5a3338232 100644 (file)
@@ -124,7 +124,7 @@ sub dispatch_request{
                        my $private = job->private || job->problem->private || job->contest && job->contest->is_running;
                        forbid !$isowner && $private;
                        my $privacy = $private ? 'private' : 'public';
-                       my @headers = ('X-Forever' => 1, 'Cache-Control' => "$privacy, max-age=604800", 'Content-Type' => CONTENT_TYPES->{job->format});
+                       my @headers = ('X-Forever' => 1, 'Cache-Control' => "$privacy, max-age=604800", 'Content-Type' => CONTENT_TYPES->{job->extension});
                        push @headers, (Vary => 'Authorization') if $private;
                        [200, \@headers, [job->source]]
                },
@@ -165,7 +165,7 @@ sub dispatch_request{
                },
 
                sub (/ed/:contest) {
-                       forbid contest->is_running;
+                       forbid !contest->is_finished;
                        my $pblist = db->problem_list(contest => $_{contest}, solution => 1);
                        response ed => 'Editorial of ' . contest->name, {%$pblist, editorial => contest->editorial};
                },
@@ -227,7 +227,6 @@ sub dispatch_request{
                        db->users->create({id => $_{username}, name => $_{name}, email => $_{email}, phone => $_{phone}, town => $_{town}, university => $_{university}, country => $_{country}, level => $_{level}});
                        db->user($_{username})->set_passphrase($_{password});
 
-                       purge '/us/';
                        reply 'Registered successfully';
                },
 
@@ -264,7 +263,6 @@ sub dispatch_request{
                                owner => remote_user->id,
                        });
 
-                       purge '/log/';
                        [303, [Location => '/log/' . $newjob->id], []]
                },
 
This page took 0.022889 seconds and 4 git commands to generate.