aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-05-19 12:04:05 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-05-26 12:41:32 +0100
commit018193054d34778488ed8e5a1669eb9e03c317cd (patch)
tree33284e882ec609f063b5992659d6d1fd1273b348 /perllib
parentd7286a011c7216cdae9e8aee21895f4f74c3277b (diff)
Use same state input in update form as elsewhere.
This lets it look the same as admin/inspect uses, with optgroups.
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm10
1 files changed, 2 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 6e94547f3..81a50dfa2 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -286,8 +286,6 @@ sub process_update : Private {
}
if ( $params{state} ) {
- $params{state} = 'fixed - council'
- if $params{state} eq 'fixed' && $c->user && $c->user->belongs_to_body( $update->problem->bodies_str );
$update->problem_state( $params{state} );
} else {
# we do this so we have a record of the state of the problem at this point
@@ -344,14 +342,10 @@ sub check_for_errors : Private {
my ( $self, $c ) = @_;
# they have to be an authority user to update the state
- if ( $c->get_param('state') ) {
+ if ( my $state = $c->get_param('state') ) {
my $error = 0;
$error = 1 unless $c->user && $c->user->belongs_to_body( $c->stash->{update}->problem->bodies_str );
-
- my $state = $c->get_param('state');
- $state = 'fixed - council' if $state eq 'fixed';
- $error = 1 unless ( grep { $state eq $_ } ( FixMyStreet::DB::Result::Problem->council_states() ) );
-
+ $error = 1 unless grep { $state eq $_ } FixMyStreet::DB::Result::Problem->council_states();
if ( $error ) {
$c->stash->{errors} ||= [];
push @{ $c->stash->{errors} }, _('There was a problem with your update. Please try again.');