aboutsummaryrefslogtreecommitdiffstats
path: root/bin/open311-populate-service-list
diff options
context:
space:
mode:
Diffstat (limited to 'bin/open311-populate-service-list')
-rw-r--r--bin/open311-populate-service-list14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/open311-populate-service-list b/bin/open311-populate-service-list
index dcdacb047..30a55c178 100644
--- a/bin/open311-populate-service-list
+++ b/bin/open311-populate-service-list
@@ -33,8 +33,22 @@ foreach my $service ( @{ $list->{service} } ) {
my $contact = $contacts->first;
if ( $contact ) {
+
print "$council already has a contact for service code " . $service->{service_code} . "\n";
push @found_contacts, $service->{service_code};
+
+ if ( $contact->deleted ) {
+ $contact->update(
+ {
+ category => $service->{service_name},
+ confirmed => 1,
+ deleted => 0,
+ editor => $0,
+ whenedited => \'ms_current_timestamp()',
+ note => 'automatically undeleted by script',
+ }
+ );
+ }
} else {
my $contact = FixMyStreet::App->model( 'DB::Contact')->create(
{