aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-09-25 22:35:39 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-12-02 17:41:35 +0000
commit55412b79394ff1b1cabe368aed67fa8f68680ecc (patch)
tree33657093517818b8ba60f156484ec540f9c4af17 /perllib/FixMyStreet/Cobrand
parent0c2a792b154e1b28528db887bbde80b19268b9fe (diff)
Reduce use of FixMyStreet::App.
Command line scripts don't need a full blown app, just database.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm6
3 files changed, 5 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 9541f2601..48c997047 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -682,7 +682,7 @@ sub get_body_sender {
if ( $body->can_be_devolved ) {
# look up via category
- my $config = FixMyStreet::App->model("DB::Contact")->search( { body_id => $body->id, category => $category } )->first;
+ my $config = $body->result_source->schema->resultset("Contact")->search( { body_id => $body->id, category => $category } )->first;
if ( $config->send_method ) {
return { method => $config->send_method, config => $config };
} else {
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 074da0915..66d8bd472 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -113,7 +113,7 @@ sub owns_problem {
if (ref $report eq 'HASH') {
return unless $report->{bodies_str};
@bodies = split /,/, $report->{bodies_str};
- @bodies = FixMyStreet::App->model('DB::Body')->search({ id => \@bodies })->all;
+ @bodies = FixMyStreet::DB->resultset('Body')->search({ id => \@bodies })->all;
} else { # Object
@bodies = values %{$report->bodies};
}
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 6da3e566c..8c08b82b1 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -850,7 +850,7 @@ sub admin_report_edit {
# Add new update from status_update
if (my $update = $c->get_param('status_update')) {
- FixMyStreet::App->model('DB::Comment')->create( {
+ $c->model('DB::Comment')->create( {
text => $update,
user => $c->user->obj,
state => 'unconfirmed',
@@ -1010,10 +1010,10 @@ sub _admin_send_email {
}
sub munge_sendreport_params {
- my ($self, $c, $row, $h, $params) = @_;
+ my ($self, $row, $h, $params) = @_;
if ($row->state =~ /^(closed|investigating)$/ && $row->get_extra_metadata('publish_photo')) {
# we attach images to reports sent to external bodies
- my $photoset = $row->get_photoset($c);
+ my $photoset = $row->get_photoset();
my @images = $photoset->all_images
or return;
my $index = 0;