diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-01-11 10:06:04 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-01-11 10:06:04 +0000 |
commit | f09978e8c1b91e1dbd37675a53581d616df48fa8 (patch) | |
tree | 203064cd4902ae833ebf558af92a313b31155e85 | |
parent | 6ecb2adb45cc6d4f072c3082b6561fd50f43e405 (diff) |
Move no more updates code within normal submission, in case they leave a final update at the same time.
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 4eedc1249..321041b92 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -236,15 +236,6 @@ sub admin_report_edit { # log here $c->res->redirect( '/admin/summary' ); - } elsif ($c->req->param('no_more_updates')) { - $c->forward('check_token'); - - $problem->bodies_str( $body->parent->id ); - $problem->state( 'planned' ); - $problem->update; - # log here - $c->res->redirect( '/admin/summary' ); - } elsif ($c->req->param('submit')) { $c->forward('check_token'); @@ -271,6 +262,14 @@ sub admin_report_edit { $c->stash->{status_message} = '<p><em>' . _('Updated!') . '</em></p>'; + # If they clicked the no more updates button, we're done. + if ($c->req->param('no_more_updates')) { + $problem->bodies_str( $body->parent->id ); + $problem->state( 'planned' ); + $problem->update; + # log here + $c->res->redirect( '/admin/summary' ); + } } $c->stash->{updates} = [ $c->model('DB::Comment') |