From: Marius Gavrilescu Date: Fri, 12 Dec 2014 15:03:42 +0000 (+0200) Subject: Fix names returned by standings X-Git-Tag: 5999.000_012~3 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=1de10923aedb415f33631532c45b3589b1fc9f48;p=gruntmaster-data.git Fix names returned by standings --- diff --git a/lib/Gruntmaster/Data/Result/Contest.pm b/lib/Gruntmaster/Data/Result/Contest.pm index 4b1c1f4..77ac716 100644 --- a/lib/Gruntmaster/Data/Result/Contest.pm +++ b/lib/Gruntmaster/Data/Result/Contest.pm @@ -212,7 +212,7 @@ sub standings { $scores{$job->rawowner}{$job->rawproblem} = int ($factor * calc_score ($value, $time, $tries{$job->rawowner}{$job->rawproblem}++, $self->stop - $self->start)); } - my %user_to_name = map { $_ => $_->name } $self->result_source->schema->users->all; + my %user_to_name = map { $_->id => $_->name } $self->result_source->schema->users->all; my @st = sort { $b->{score} <=> $a->{score} or $a->{user} cmp $b->{user} } map { ## no critic (ProhibitReverseSortBlock) my $user = $_;