From c016b64482812bf81dc02402ddc3aa80cfc25cf9 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 23 Jan 2015 16:43:25 +0200 Subject: [PATCH] Do not detach solution twice --- lib/Plack/App/Gruntmaster/HTML.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 40d46af..91699e6 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -156,10 +156,10 @@ sub process_pb_entry { $tree->fid('score')->attr('data-value' => $args{value}); $tree->fid('score')->replace_content(Gruntmaster::Data::Result::Contest::calc_score($args{value}, $args{time} - $args{open_time}, 0, $args{contest_stop} - $args{contest_start})); } else { + $tree->fid('solution')->detach unless $args{solution}; $_->detach for $tree->fclass('rc'); # requires contest $tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution}); } - $tree->fid('solution')->detach unless $args{solution}; if ($args{cansubmit}) { $tree->look_down(name => 'problem')->attr(value => $args{id}); my $contest = $tree->look_down(name => 'contest'); -- 2.39.2