aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/Update.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-27 11:03:57 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-27 11:03:57 +0100
commita20fc533b0f10646814742f1348c5f9141217efa (patch)
tree742b49b1347262bd971e397f1d3d52be7c7140d7 /perllib/FixMyStreet/App/Controller/Report/Update.pm
parentdf18e6c8b434dfd86177cf5041278fd46d6d2ea7 (diff)
change to use from_council in users table and store the council id in
there so we can check that the problem is for the council the user is from
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 2d810d871..652694595 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -153,7 +153,8 @@ sub process_update : Private {
if ( $params{state} ) {
$params{state} = 'fixed - council'
- if $params{state} eq 'fixed' && $c->user && $c->user->from_authority;
+ if $params{state} eq 'fixed' && $c->user && $c->user->from_council
+ && $c->user->from_council == $update->problem->council;
$update->problem_state( $params{state} );
}
@@ -177,7 +178,7 @@ sub check_for_errors : Private {
# they have to be an authority user to update the state
if ( $c->req->param('state') ) {
my $error = 0;
- $error = 1 unless $c->user && $c->user->from_authority;
+ $error = 1 unless $c->user && $c->user->from_council && $c->user->from_council == $c->stash->{update}->problem->council;
my $state = $c->req->param('state');
$error = 1 unless ( grep { $state eq $_ } ( qw/closed fixed investigating planned/, 'in progress', 'fixed', 'fixed - user', 'fixed - council' ) );