aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-05-23 08:30:03 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-05-23 11:45:14 +0100
commitc525f570acef784e09824d1444feffd7949b9ace (patch)
treeb5dd77f166885864461a0c7fd1ee3a9de5c9ac35
parente305e5f0bd2c07aca54a3fc1453751ceca5f3509 (diff)
[UK] Update 2019 local government handling.
-rw-r--r--perllib/FixMyStreet/MapIt.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm4
-rw-r--r--t/app/sendreport/email.t3
3 files changed, 4 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/MapIt.pm b/perllib/FixMyStreet/MapIt.pm
index d0a5f4760..238c5c62c 100644
--- a/perllib/FixMyStreet/MapIt.pm
+++ b/perllib/FixMyStreet/MapIt.pm
@@ -10,7 +10,7 @@ sub call {
# point in specifying it for that. 'areas' similarly if given IDs, but we
# might be looking up types or names, so might as well specify it then.
$opts{generation} = FixMyStreet->config('MAPIT_GENERATION')
- if $url ne 'area' && FixMyStreet->config('MAPIT_GENERATION');
+ if !$opts{generation} && $url ne 'area' && FixMyStreet->config('MAPIT_GENERATION');
return mySociety::MaPit::call($url, $params, %opts);
}
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index cd697fa0f..679530507 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -20,7 +20,7 @@ sub build_recipient_list {
my ($body_email, $state, $note) = ( $contact->email, $contact->state, $contact->note );
$body_email = swandt_contact($row->latitude, $row->longitude)
- if ($body->areas->{2427} || $body->areas->{2429}) && $body_email eq 'SPECIAL';
+ if $body->name eq 'Somerset West and Taunton Council' && $body_email eq 'SPECIAL';
unless ($state eq 'confirmed') {
$all_confirmed = 0;
@@ -126,7 +126,7 @@ sub swandt_contact {
sub _get_district_for_contact {
my ( $lat, $lon ) = @_;
my $district =
- FixMyStreet::MapIt::call( 'point', "4326/$lon,$lat", type => 'DIS' );
+ FixMyStreet::MapIt::call( 'point', "4326/$lon,$lat", type => 'DIS', generation => 34 );
($district) = keys %$district;
return $district;
}
diff --git a/t/app/sendreport/email.t b/t/app/sendreport/email.t
index 3e6db4f67..7480d6aab 100644
--- a/t/app/sendreport/email.t
+++ b/t/app/sendreport/email.t
@@ -69,8 +69,7 @@ foreach my $test ( {
};
}
-$body->body_areas->delete;
-$body->body_areas->create({ area_id => 2429 });
+$body->update({ name => 'Somerset West and Taunton Council' });
subtest 'Test special behaviour' => sub {
my $e = FixMyStreet::SendReport::Email->new;