diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-09-25 22:35:39 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-12-02 17:41:35 +0000 |
commit | 55412b79394ff1b1cabe368aed67fa8f68680ecc (patch) | |
tree | 33657093517818b8ba60f156484ec540f9c4af17 /perllib/FixMyStreet/SendReport/Zurich.pm | |
parent | 0c2a792b154e1b28528db887bbde80b19268b9fe (diff) |
Reduce use of FixMyStreet::App.
Command line scripts don't need a full blown app, just database.
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Zurich.pm')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Zurich.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm index 2838440cb..7af4cf4f5 100644 --- a/perllib/FixMyStreet/SendReport/Zurich.pm +++ b/perllib/FixMyStreet/SendReport/Zurich.pm @@ -14,7 +14,7 @@ sub build_recipient_list { # Wunsch set, but external_message hasn't yet been filled in. TODO should # we instead be holding off sending?) if ( $row->external_body ) { - $body = FixMyStreet::App->model("DB::Body")->find( { id => $row->external_body } ); + $body = $row->result_source->schema->resultset("Body")->find( { id => $row->external_body } ); $h->{bodies_name} = $body->name; $h->{external_message} = $row->get_extra_metadata('external_message') || ''; } @@ -29,7 +29,7 @@ sub build_recipient_list { my $parent = $body->parent; if ($parent && !$parent->parent) { # Division, might have an individual contact email address - my $contact = FixMyStreet::App->model("DB::Contact")->find( { + my $contact = $row->result_source->schema->resultset("Contact")->find( { body_id => $body->id, category => $row->category } ); @@ -72,7 +72,7 @@ sub send_from { if ( $row->external_body ) { my $body = @{ $self->bodies }[0]; my $body_email = $body->endpoint; - my $contact = FixMyStreet::App->model("DB::Contact")->find( { + my $contact = $body->result_source->schema->resultset("Contact")->find( { body_id => $body->id, category => $row->category } ); |