aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Open311.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-06-13 18:39:05 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-06-20 15:02:11 +0100
commite57cbf483790bedfef6496be3c7ffa42882c3ffc (patch)
treed01788502457f801a846cdac78213df5ecdf1ea5 /perllib/FixMyStreet/App/Controller/Open311.pm
parenta5f311e5147621f285cf31647ce675c502095882 (diff)
[UK] Remove requirement for fixed body IDs.
Historically in UK cobrands, bodies have had IDs the same as the MapIt area ID they cover. This can be confusing (if you are setting up a dev environment, say) and should not be necessary. This commit removes the requirement entirely, by switching any ID checks to either the name of the body, or the actual area it covers. One note: the body name in the test has to match so that we do not get two bodies both covering 2237 created. This will not be necessary when the tests are compartmentalized in the next commit.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Open311.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Open311.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm
index bc08593de..6829e01ae 100644
--- a/perllib/FixMyStreet/App/Controller/Open311.pm
+++ b/perllib/FixMyStreet/App/Controller/Open311.pm
@@ -258,8 +258,8 @@ sub output_requests : Private {
}
else {
# FIXME Not according to Open311 v2
- my @body_names = map { $_->name } values %{$problem->bodies};
- $request->{agency_responsible} = {'recipient' => [ @body_names ] };
+ my $body_names = $problem->body_names;
+ $request->{agency_responsible} = {'recipient' => $body_names };
}
if ( !$problem->anonymous ) {