diff options
author | Struan Donald <struan@exo.org.uk> | 2011-10-21 12:56:02 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-10-21 12:56:02 +0100 |
commit | 93954c13d149ff7ab42a9365bd6994ed98e14ba1 (patch) | |
tree | 404a751a5251a96d42724e50e2cebd5b44a3dd41 /perllib/Open311 | |
parent | 9ade8e294b263c83f49d25e98d132686d35c2896 (diff) |
temporary fix to make cambridgeshire use description and not service_name
Diffstat (limited to 'perllib/Open311')
-rw-r--r-- | perllib/Open311/PopulateServiceList.pm | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm index 68a9a1750..48e90a1d5 100644 --- a/perllib/Open311/PopulateServiceList.pm +++ b/perllib/Open311/PopulateServiceList.pm @@ -77,13 +77,17 @@ sub process_services { sub process_service { my $self = shift; - print $self->_current_service->{service_code} . ': ' . $self->_current_service->{service_name} . "\n"; + my $category = $self->_current_council->area_id == 2218 ? + $self->_current_service->{description} : + $self->_current_service->{service_name}; + + print $self->_current_service->{service_code} . ': ' . $category . "\n"; my $contacts = FixMyStreet::App->model( 'DB::Contact')->search( { area_id => $self->_current_council->area_id, -OR => [ email => $self->_current_service->{service_code}, - category => $self->_current_service->{service_name} + category => $category, ] } ); @@ -92,7 +96,7 @@ sub process_service { sprintf( "Multiple contacts for service code %s, category %s - Skipping\n", $self->_current_service->{service_code}, - $self->_current_service->{service_name}, + $category, ); # best to not mark them as deleted as we don't know what we're doing @@ -200,9 +204,13 @@ sub _add_contact_to_meta { sub _normalize_service_name { my $self = shift; + # FIXME - at the moment it makes more sense to use the description + # for cambridgeshire but need a more flexible way to set this + my $service_name = $self->_current_council->area_id == 2218 ? + $self->_current_service->{description} : + $self->_current_service->{service_name}; # remove trailing whitespace as it upsets db queries # to look up contact details when creating problem - my $service_name = $self->_current_service->{service_name}; $service_name =~ s/\s+$//; return $service_name; |