aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/UK.pm
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
committerMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
commit987124b09a32248414faf4d0d6615d43b29ac6f6 (patch)
treea549db8af723c981d3b346e855f25d6fd5ff8aa7 /perllib/FixMyStreet/Cobrand/UK.pm
parentdbf56159e44c1560a413022451bf1a1c4cb22a52 (diff)
parenta085b63ce09f87e83b75cda9b9cd08aadfe75d61 (diff)
Merge tag 'v2.0.4' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/UK.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/UK.pm10
1 files changed, 3 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm
index 08ecf0b7d..945af48f8 100644
--- a/perllib/FixMyStreet/Cobrand/UK.pm
+++ b/perllib/FixMyStreet/Cobrand/UK.pm
@@ -1,5 +1,6 @@
package FixMyStreet::Cobrand::UK;
use base 'FixMyStreet::Cobrand::Default';
+use strict;
use JSON::MaybeXS;
use mySociety::MaPit;
@@ -354,13 +355,8 @@ sub get_body_handler_for_problem {
my @bodies = values %{$row->bodies};
my %areas = map { %{$_->areas} } @bodies;
- foreach my $avail ( FixMyStreet::Cobrand->available_cobrand_classes ) {
- my $class = FixMyStreet::Cobrand->get_class_for_moniker($avail->{moniker});
- my $cobrand = $class->new({});
- next unless $cobrand->can('council_id');
- return $cobrand if $areas{$cobrand->council_id};
- }
-
+ my $cobrand = FixMyStreet::Cobrand->body_handler(\%areas);
+ return $cobrand if $cobrand;
return ref $self ? $self : $self->new;
}