aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report
diff options
context:
space:
mode:
authorJon Kristensen <info@jonkri.com>2014-05-15 17:41:07 +0200
committerJon Kristensen <info@jonkri.com>2014-05-15 17:41:07 +0200
commitd6ab834a8e1fb67800785eb781e4f9ecc2e39a5c (patch)
tree57330eaed413dd8a200e2d49b1deb91b69dad79f /perllib/FixMyStreet/App/Controller/Report
parent87b7c87e1cf83ba043a0254008248595363906c1 (diff)
parent966a1a754d7f4f055944212c5523798a7795402f (diff)
Merge branch 'master' of git://github.com/mysociety/fixmystreet into jonkri-master
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm25
1 files changed, 10 insertions, 15 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 761215344..1e9f83aec 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -624,15 +624,13 @@ sub setup_categories_and_bodies : Private {
_('Empty public building - school, hospital, etc.')
);
- } elsif ($first_area->{id} != COUNCIL_ID_BROMLEY && $first_area->{type} eq 'LBO') {
+ } elsif ($first_area->{id} != COUNCIL_ID_BROMLEY
+ && $first_area->{id} != COUNCIL_ID_BARNET
+ && $first_area->{type} eq 'LBO') {
$bodies_to_list{ $first_body->id } = 1;
my @local_categories;
- if ($first_area->{id} == COUNCIL_ID_BARNET) {
- @local_categories = sort keys %{ Utils::barnet_categories() }
- } else {
- @local_categories = sort keys %{ Utils::london_categories() }
- }
+ @local_categories = sort keys %{ Utils::london_categories() };
@category_options = (
_('-- Pick a category --'),
@local_categories
@@ -853,15 +851,10 @@ sub process_report : Private {
$report->extra( \%extra );
}
- } elsif ( $first_area->{id} == COUNCIL_ID_BARNET ) {
+ } elsif ($first_area->{id} != COUNCIL_ID_BROMLEY
+ && $first_area->{id} != COUNCIL_ID_BARNET
+ && $first_area->{type} eq 'LBO') {
- unless ( exists Utils::barnet_categories()->{ $report->category } ) {
- $c->stash->{field_errors}->{category} = _('Please choose a category');
- }
- $report->bodies_str( $first_body->id );
-
- } elsif ( $first_area->{id} != COUNCIL_ID_BROMLEY && $first_area->{type} eq 'LBO') {
-
unless ( Utils::london_categories()->{ $report->category } ) {
$c->stash->{field_errors}->{category} = _('Please choose a category');
}
@@ -1155,7 +1148,9 @@ sub redirect_or_confirm_creation : Private {
$report_uri = $c->cobrand->base_url_for_report( $report ) . $report->url;
}
$c->log->info($report->user->id . ' was logged in, redirecting to /report/' . $report->id);
- $c->flash->{created_report} = 'loggedin';
+ if ( $c->sessionid ) {
+ $c->flash->{created_report} = 'loggedin';
+ }
$c->res->redirect($report_uri);
$c->detach;
}