aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-02-07 12:27:11 +0000
committerMatthew Somerville <matthew@mysociety.org>2013-02-07 15:31:47 +0000
commitb3d7a5d7c3e145bfe530fa41672b23850e26a904 (patch)
treecb19b8ff8624ab72f4b36771b5af95978392d995 /perllib/FixMyStreet/SendReport
parent8a3f7d28e392226374b0829d26bfec5c49b580b6 (diff)
Fix body name in external assignment email, missing %s in translation, associated tests (fix a28).
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-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,