aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-12-02 17:45:03 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-12-02 17:45:03 +0000
commitb6fcd966d204d35c149b2bff91513e732f3101c8 (patch)
tree75fb01b3910fc4093584bb3b9056e9ea6dbe0eba /perllib/FixMyStreet/Cobrand
parent8543192128ed15c9bc73e3686ab03324ee5e2b11 (diff)
parent7b20745945638cce030879eafc8cac8f8bd81c56 (diff)
Merge branch 'reduce-fixmystreet-app'
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm4
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm6
3 files changed, 6 insertions, 6 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..0fb8c23d0 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -43,7 +43,7 @@ sub problems {
sub base_url {
my $self = shift;
- my $base_url = mySociety::Config::get('BASE_URL');
+ my $base_url = FixMyStreet->config('BASE_URL');
my $u = $self->council_url;
if ( $base_url !~ /$u/ ) {
# council cobrands are not https so transform to http as well
@@ -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 1376f1e45..b7c9e9f45 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;