aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2014-07-24 16:39:03 +0000
committerHakim Cassimally <hakim@mysociety.org>2014-10-16 16:56:27 +0000
commit9dacce035c39b52e66b6ebed23b9c33613375ca4 (patch)
treedb1fb916112e9d4e04d4dee6d1d8c9284446dec9 /perllib/FixMyStreet/SendReport
parentf44cd4682389d394129a89ee44005b7842b41964 (diff)
Open311 tweaks to get round-tripping working
If https://github.com/mysociety/fixmystreet/pull/792 is accepted then this should be rewritten in terms of that.
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm
index ce5ee80a0..c064eeef5 100644
--- a/perllib/FixMyStreet/SendReport/Open311.pm
+++ b/perllib/FixMyStreet/SendReport/Open311.pm
@@ -12,6 +12,7 @@ use Open311;
use Readonly;
Readonly::Scalar my $COUNCIL_ID_OXFORDSHIRE => 2237;
+Readonly::Scalar my $COUNCIL_ID_WARWICKSHIRE => 2243;
sub send {
my $self = shift;
@@ -65,7 +66,7 @@ sub send {
}
# extra Oxfordshire fields: send nearest street, postcode, northing and easting, and the FMS id
- if ( $row->bodies_str =~ /$COUNCIL_ID_OXFORDSHIRE/ ) {
+ if ( $row->bodies_str =~ /\b(?:$COUNCIL_ID_OXFORDSHIRE|$COUNCIL_ID_WARWICKSHIRE)\b/ ) {
my $extra = $row->extra;
push @$extra, { name => 'external_id', value => $row->id };
@@ -76,7 +77,12 @@ sub send {
}
$row->extra( $extra );
- $extended_desc = 'oxfordshire';
+ if ($row->bodies_str =~ /$COUNCIL_ID_OXFORDSHIRE/) {
+ $extended_desc = 'oxfordshire';
+ }
+ elsif ($row->bodies_str =~ /$COUNCIL_ID_WARWICKSHIRE/) {
+ $extended_desc = 'warwickshire';
+ }
}
# FIXME: we've already looked this up before