diff options
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 10 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Barnet.pm | 6 | ||||
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 62bea1dd4..997577b69 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -164,19 +164,19 @@ sub body { =head2 belongs_to_body - $belongs_to_body = $user->belongs_to_body( $council_list ); + $belongs_to_body = $user->belongs_to_body( $bodies ); -Returns true if the user belongs to the comma seperated list of council ids passed in +Returns true if the user belongs to the comma seperated list of body ids passed in =cut sub belongs_to_body { my $self = shift; - my $council = shift; + my $bodies = shift; - my %councils = map { $_ => 1 } split ',', $council; + my %bodies = map { $_ => 1 } split ',', $bodies; - return 1 if $self->from_body && $councils{ $self->from_body }; + return 1 if $self->from_body && $bodies{ $self->from_body }; return 0; } diff --git a/perllib/FixMyStreet/SendReport/Barnet.pm b/perllib/FixMyStreet/SendReport/Barnet.pm index 4bee50e57..21d4a06a5 100644 --- a/perllib/FixMyStreet/SendReport/Barnet.pm +++ b/perllib/FixMyStreet/SendReport/Barnet.pm @@ -80,9 +80,9 @@ sub send { ? $h{query} : $nearest_postcode; # use given postcode if available # note: endpoint can be of form 'https://username:password@url' - my $council_config = FixMyStreet::App->model("DB::Body")->search( { area_id => COUNCIL_ID_BARNET} )->first; - if ($council_config and $council_config->endpoint) { - $interface->set_proxy($council_config->endpoint); + my $body = FixMyStreet::App->model("DB::Body")->search( { area_id => COUNCIL_ID_BARNET} )->first; + if ($body and $body->endpoint) { + $interface->set_proxy($body->endpoint); # Barnet web service doesn't like namespaces in the elements so use a prefix $interface->set_prefix('urn'); # uncomment these lines to print XML that will be sent rather diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index 4e64e350f..875769eac 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -45,7 +45,7 @@ sub fetch { } sub update_comments { - my ( $self, $open311, $council_details ) = @_; + my ( $self, $open311, $body_details ) = @_; my @args = (); @@ -55,7 +55,7 @@ sub update_comments { push @args, $self->start_date; push @args, $self->end_date; # default to asking for last 2 hours worth if not Bromley - } elsif ( $council_details->{areaid} != 2482 ) { + } elsif ( $body_details->{areaid} != 2482 ) { my $end_dt = DateTime->now(); my $start_dt = $end_dt->clone; $start_dt->add( hours => -2 ); @@ -67,7 +67,7 @@ sub update_comments { my $requests = $open311->get_service_request_updates( @args ); unless ( $open311->success ) { - warn "Failed to fetch ServiceRequest Updates for " . $council_details->{areaid} . ":\n" . $open311->error + warn "Failed to fetch ServiceRequest Updates for " . $body_details->{areaid} . ":\n" . $open311->error if $self->verbose; return 0; } @@ -83,7 +83,7 @@ sub update_comments { FixMyStreet::App->model('DB::Problem') ->search( { external_id => $request_id, - bodies_str => { like => '%' . $council_details->{areaid} . '%' }, + bodies_str => { like => '%' . $body_details->{areaid} . '%' }, } ); if (my $p = $problem->first) { |