From 8bd66733a4d66baf38f69ea36154d1873ad5edba Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 11 Dec 2014 23:50:15 +0200 Subject: [PATCH] Add the solution to pb_entry when not in contest --- lib/Gruntmaster/Data.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index ce87c25..9cb313d 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -116,8 +116,10 @@ sub problem_list { sub problem_entry { my ($self, $id, $contest, $user) = @_; - my $pb = $self->problems->find($id, {columns => PROBLEM_PUBLIC_COLUMNS, prefetch => 'owner'}); my $running = $contest && $self->contest($contest)->is_running; + my $columns = PROBLEM_PUBLIC_COLUMNS; + push @$columns, 'solution' unless $running; + my $pb = $self->problems->find($id, {columns => $columns, prefetch => 'owner'}); eval { ## no critic (RequireCheckingReturnValueOfEval) $self->opens->create({ contest => $contest, -- 2.39.2