aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Open311.pm
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2012-12-12 11:33:54 +0000
committerDave Whiteland <dave@mysociety.org>2012-12-12 11:33:54 +0000
commit0ebc4093bfdc047e1d74c815fb39ddf104a22ed1 (patch)
treeb37592e908e2f71bd8b4fa0dd80da2ec46a8bc6c /perllib/FixMyStreet/SendReport/Open311.pm
parentb09b6aa5cf013dc9a0acdfcf0669ce16c0f0502f (diff)
use Readonly for Oxfordshire council name
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Open311.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm
index c4b99423a..7b8f98bfd 100644
--- a/perllib/FixMyStreet/SendReport/Open311.pm
+++ b/perllib/FixMyStreet/SendReport/Open311.pm
@@ -9,6 +9,9 @@ use FixMyStreet::App;
use mySociety::Config;
use DateTime::Format::W3CDTF;
use Open311;
+use Readonly;
+
+Readonly::Scalar my $COUNCIL_ID_OXFORDSHIRE => 2237;
sub should_skip {
my $self = shift;
@@ -68,7 +71,7 @@ sub send {
}
# extra Oxfordshire fields: send northing and easting
- if ( $row->council =~ /2237/ ) {
+ if ( $row->council =~ /$COUNCIL_ID_OXFORDSHIRE/ ) {
my $extra = $row->extra;
if ( $row->used_map || ( !$row->used_map && !$row->postcode ) ) {
push @$extra, { name => 'northing', value => $h->{northing} };
@@ -105,14 +108,14 @@ sub send {
}
if ($row->cobrand eq 'fixmybarangay') {
- # FixMyBarangay endpoints expect external_id as an attribute
+ # FixMyBarangay endpoints expect external_id as an attribute, as do Oxfordshire
$row->extra( [ { 'name' => 'external_id', 'value' => $row->id } ] );
}
my $resp = $open311->send_service_request( $row, $h, $contact->email );
# make sure we don't save user changes from above
- if ( $row->council =~ /(2218|2482|2237)/ || $row->cobrand eq 'fixmybarangay') {
+ if ( $row->council =~ /(2218|2482|$COUNCIL_ID_OXFORDSHIRE)/ || $row->cobrand eq 'fixmybarangay') {
$row->discard_changes();
}