From 526b9e807f925f5a2f58d0b134444755117da83d Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 3 Aug 2014 00:20:22 +0300 Subject: [PATCH] Fix bugs in user_list and set_passphrase --- lib/Gruntmaster/Data.pm | 6 +++--- lib/Gruntmaster/Data/Result/User.pm | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index 1e268af..5754491 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -103,9 +103,9 @@ sub job_list { my ($self, %args) = @_; $args{page} //= 1; my $rs = $self->jobs->search(undef, {order_by => {-desc => 'me.id'}, prefetch => ['problem', 'owner'], rows => JOBS_PER_PAGE, offset => ($args{page} - 1) * JOBS_PER_PAGE}); - $rs = $rs->search({owner => $args{owner}}) if $args{owner}; - $rs = $rs->search({contest => $args{contest}}) if $args{contest}; - $rs = $rs->search({problem => $args{problem}}) if $args{problem}; + $rs = $rs->search({'me.owner' => $args{owner}}) if $args{owner}; + $rs = $rs->search({contest => $args{contest}}) if $args{contest}; + $rs = $rs->search({problem => $args{problem}}) if $args{problem}; [map { my %params = $_->get_columns; $params{owner_name} = $_->owner->name; diff --git a/lib/Gruntmaster/Data/Result/User.pm b/lib/Gruntmaster/Data/Result/User.pm index 4385b76..54e6b52 100644 --- a/lib/Gruntmaster/Data/Result/User.pm +++ b/lib/Gruntmaster/Data/Result/User.pm @@ -191,7 +191,7 @@ sub set_passphrase { cost => 10, passphrase => $pw, salt_random => 1, - )})->as_rfc2307; + )->as_rfc2307}); } 1; -- 2.39.2