diff options
author | Struan Donald <struan@exo.org.uk> | 2011-07-27 13:54:46 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-07-27 13:54:46 +0100 |
commit | e1801441beb37f37857c925a3c8c889653da4fe9 (patch) | |
tree | d12e6335e11da59396f109bc93abf128bf13089c /perllib/FixMyStreet/App/Controller/Report/Update.pm | |
parent | 54066cd1387643dd6c6cb3040c520bee66881fd7 (diff) |
allow council user to update state on problem sent to multiple councils
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 03130f60b..add9d1371 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -180,8 +180,7 @@ sub process_update : Private { if ( $params{state} ) { $params{state} = 'fixed - council' - if $params{state} eq 'fixed' && $c->user && $c->user->from_council - && $c->user->from_council == $update->problem->council; + if $params{state} eq 'fixed' && $c->user && $c->user->belongs_to_council( $update->problem->council ); $update->problem_state( $params{state} ); } @@ -205,7 +204,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_council && $c->user->from_council == $c->stash->{update}->problem->council; + $error = 1 unless $c->user && $c->user->belongs_to_council( $c->stash->{update}->problem->council ); my $state = $c->req->param('state'); $error = 1 unless ( grep { $state eq $_ } ( qw/confirmed closed fixed investigating planned/, 'in progress', 'fixed', 'fixed - user', 'fixed - council' ) ); |