diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2014-07-24 16:39:03 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2014-10-16 16:56:27 +0000 |
commit | 9dacce035c39b52e66b6ebed23b9c33613375ca4 (patch) | |
tree | db1fb916112e9d4e04d4dee6d1d8c9284446dec9 /perllib | |
parent | f44cd4682389d394129a89ee44005b7842b41964 (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')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Open311.pm | 10 | ||||
-rw-r--r-- | perllib/Open311/Endpoint/Role/mySociety.pm | 3 |
2 files changed, 10 insertions, 3 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 diff --git a/perllib/Open311/Endpoint/Role/mySociety.pm b/perllib/Open311/Endpoint/Role/mySociety.pm index 3669c585b..de65baab6 100644 --- a/perllib/Open311/Endpoint/Role/mySociety.pm +++ b/perllib/Open311/Endpoint/Role/mySociety.pm @@ -68,7 +68,8 @@ sub GET_Service_Request_Updates_input_schema { $self->get_jurisdiction_id_required_clause, }, optional => { - $self->get_jurisdiction_id_optional_clause,, + $self->get_jurisdiction_id_optional_clause, + api_key => $self->get_identifier_type('api_key'), start_date => '/open311/datetime', end_date => '/open311/datetime', } |