aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script/Alerts.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-07-02 16:36:35 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-07-02 16:36:35 +0100
commit6e3ea5f3fbc56919dd183276bfb84b1deef9c21c (patch)
treecbf63e1977ea545e2f2fa625f9a3444af3b4273a /perllib/FixMyStreet/Script/Alerts.pm
parent3b45695dddd4aa35e7b04a2a10b8e7732217e155 (diff)
parentdadddc42f5e5c4b3a02db9171a485885b1e365a7 (diff)
Merge branch 'use-the-body-id'
Diffstat (limited to 'perllib/FixMyStreet/Script/Alerts.pm')
-rw-r--r--perllib/FixMyStreet/Script/Alerts.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Script/Alerts.pm b/perllib/FixMyStreet/Script/Alerts.pm
index 4b5641f9e..a0c25a8fc 100644
--- a/perllib/FixMyStreet/Script/Alerts.pm
+++ b/perllib/FixMyStreet/Script/Alerts.pm
@@ -185,9 +185,12 @@ sub send() {
# Get a report object for its photo and static map
$data{report} = $schema->resultset('Problem')->find({ id => $row->{id} });
}
- if ($ref eq 'area_problems' || $ref eq 'council_problems' || $ref eq 'ward_problems') {
+ if ($ref eq 'area_problems') {
my $va_info = mySociety::MaPit::call('area', $row->{alert_parameter});
$data{area_name} = $va_info->{name};
+ } elsif ($ref eq 'council_problems' || $ref eq 'ward_problems') {
+ my $body = FixMyStreet::DB->resultset('Body')->find({ id => $row->{alert_parameter} });
+ $data{area_name} = $body->name;
}
if ($ref eq 'ward_problems') {
my $va_info = mySociety::MaPit::call('area', $row->{alert_parameter2});