Date: Fri, 8 Jun 2012 08:23:55 +0000 (UTC) From: Dag-Erling Smorgrav <des@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r236739 - user/des/fbce/lib/FBCE/Controller Message-ID: <201206080823.q588Ntw6042682@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: des Date: Fri Jun 8 08:23:55 2012 New Revision: 236739 URL: http://svn.freebsd.org/changeset/base/236739 Log: Don't try to interpolate a method call. Modified: user/des/fbce/lib/FBCE/Controller/Vote.pm Modified: user/des/fbce/lib/FBCE/Controller/Vote.pm ============================================================================== --- user/des/fbce/lib/FBCE/Controller/Vote.pm Fri Jun 8 08:04:51 2012 (r236738) +++ user/des/fbce/lib/FBCE/Controller/Vote.pm Fri Jun 8 08:23:55 2012 (r236739) @@ -47,7 +47,8 @@ sub index :Path :Args(0) { } $candidates->reset; if (scalar keys %vote_for > $c->stash->{'max_votes'}) { - $error = "You can only vote for $c->stash->{'max_votes'} candidates."; + $c->stash(error => "You can only vote for " . + $c->stash->{'max_votes'} . " candidates."); } else { my $schema = $user->result_source->schema; $schema->txn_do(sub { @@ -57,7 +58,7 @@ sub index :Path :Args(0) { } }); if ($@) { - $error = "Database error!"; + $c->stash(error => "Database error!"); } else { $c->stash(vote_ok => 1); } @@ -68,9 +69,7 @@ sub index :Path :Args(0) { $voted_for{$vote->candidate->login} = 1; } } - $c->stash(error => $error); $c->stash(candidates => $candidates); - $c->stash(max_votes => $c->stash->{'max_votes'}); $c->stash(voted_for => \%voted_for); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206080823.q588Ntw6042682>