diff options
Diffstat (limited to 'web')
-rwxr-xr-x | web/alert.cgi | 2 | ||||
-rwxr-xr-x | web/index.cgi | 6 | ||||
-rwxr-xr-x | web/reports.cgi | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/web/alert.cgi b/web/alert.cgi index 5a7aef1fc..108a02683 100755 --- a/web/alert.cgi +++ b/web/alert.cgi @@ -106,7 +106,7 @@ sub alert_list { my $areas = mySociety::MaPit::call('point', "27700/$e,$n", type => \@types); my $cobrand = Page::get_cobrand($q); - my ($success, $error_msg) = Cobrand::council_check($cobrand, $areas, $q, 'alert'); + my ($success, $error_msg) = Cobrand::council_check($cobrand, { all_councils => $areas }, $q, 'alert'); if (!$success){ return alert_front_page($q, $error_msg); } diff --git a/web/index.cgi b/web/index.cgi index a3ac1296c..dcbec5a1c 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -513,7 +513,7 @@ sub display_form { my $all_councils = mySociety::MaPit::call('point', "27700/$easting,$northing", type => $parent_types); # Let cobrand do a check - my ($success, $error_msg) = Cobrand::council_check($cobrand, $all_councils, $q, 'submit_problem'); + my ($success, $error_msg) = Cobrand::council_check($cobrand, { all_councils => $all_councils }, $q, 'submit_problem'); if (!$success){ return front_page($q, $error_msg); } @@ -808,9 +808,7 @@ sub display_location { } # Check this location is okay to be displayed for the cobrand - my $parent_types = $mySociety::VotingArea::council_parent_types; - my $all_councils = mySociety::MaPit::call('point', "27700/$easting,$northing", type => $parent_types); - my ($success, $error_msg) = Cobrand::council_check($cobrand, $all_councils, $q, 'display_location'); + my ($success, $error_msg) = Cobrand::council_check($cobrand, { e => $easting, n => $northing }, $q, 'display_location'); return front_page($q, $error_msg) unless $success; # Deal with pin hiding/age diff --git a/web/reports.cgi b/web/reports.cgi index bc418db7c..4faee63f9 100755 --- a/web/reports.cgi +++ b/web/reports.cgi @@ -67,6 +67,10 @@ sub main { } } elsif ($q_council =~ /^\d+$/) { my $va_info = mySociety::MaPit::call('area', $q_council); + if ($va_info->{error}) { + print $q->redirect($base_url . '/reports'); + return; + } $area_name = $va_info->{name}; print $q->redirect($base_url . '/reports/' . Page::short_name($area_name)); return; |