aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Zurich.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-02-21 12:31:17 +0000
committerMatthew Somerville <matthew@mysociety.org>2013-02-21 12:31:17 +0000
commite2bf144a6aaa19779fc55a04081a3c269b9d0f81 (patch)
tree00318d801d35948938743608252fccd2d1b4e585 /perllib/FixMyStreet/SendReport/Zurich.pm
parenteb0c0d42f3596c5dc21e9bcdcc02a4008a541c34 (diff)
parentf8a8948ddb790e7e7593d538c55a3a278fbf3973 (diff)
Merge remote branch 'origin/zurich'
(locale ignored, will rerun .po extraction after to get all changes.) Conflicts: locale/FixMyStreet.po locale/cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po locale/nn_NO.UTF-8/LC_MESSAGES/FixMyStreet.po templates/web/fixmystreet/report/banner.html templates/web/zurich/faq/faq-de-ch.html
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Zurich.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Zurich.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm
index e0c95283e..4930ff61e 100644
--- a/perllib/FixMyStreet/SendReport/Zurich.pm
+++ b/perllib/FixMyStreet/SendReport/Zurich.pm
@@ -9,12 +9,14 @@ sub build_recipient_list {
# Only one body ever, most of the time with an email endpoint
my $body = @{ $self->bodies }[0];
- $body = FixMyStreet::App->model("DB::Body")->find( { id => $row->external_body } )
- if $row->external_body;
+ if ( $row->external_body ) {
+ $body = FixMyStreet::App->model("DB::Body")->find( { id => $row->external_body } );
+ $h->{bodies_name} = $body->name;
+ }
my $body_email = $body->endpoint;
- my @bodies = $body->bodies;
- if ($body->parent && @bodies) {
+ my $parent = $body->parent;
+ if ($parent && !$parent->parent) {
# Division, might have an individual contact email address
my $contact = FixMyStreet::App->model("DB::Contact")->find( {
body_id => $body->id,