Do not show users with no jobs in user_list
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 15 Feb 2015 16:30:11 +0000 (18:30 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 15 Feb 2015 16:30:11 +0000 (18:30 +0200)
lib/Gruntmaster/Data.pm

index 28b520a69e5b7031e276743ec5f4b2d8754441ed..d9f61aa172afab7f8c484650d7c9423e93b9deb3 100644 (file)
@@ -56,13 +56,14 @@ sub user_list {
        }
        $contests{$_->rawowner}++ for $self->contest_statuses->all;
 
-       [ sort { $b->{solved} <=> $a->{solved} or $b->{attempted} <=> $a->{attempted} } map { ## no critic (ProhibitReverseSort)
-               my $id = $_->id;
-               +{ $_->get_columns,
-                  solved => ($solved{$id} // 0),
-                  attempted => ($attempted{$id} // 0),
-                  contests => ($contests{$id} // 0) }
-       } $rs->all ]
+       [ sort { $b->{solved} <=> $a->{solved} or $b->{attempted} <=> $a->{attempted} } ## no critic (ProhibitReverseSort)
+               grep { $_->{solved} || $_->{attempted} } map {
+                       my $id = $_->id;
+                       +{ $_->get_columns,
+                          solved => ($solved{$id} // 0),
+                          attempted => ($attempted{$id} // 0),
+                          contests => ($contests{$id} // 0) }
+               } $rs->all ]
 }
 
 sub user_entry {
This page took 0.011433 seconds and 4 git commands to generate.