diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2014-10-16 08:35:22 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2014-10-16 16:57:00 +0000 |
commit | 1d66428dcc75a47c02f5cbd567effc567d38951f (patch) | |
tree | 7c61eb441dff9bdaca928eb5b10a768e8f162ebe /perllib | |
parent | 807eb73734bff70b9f16c61f68fce7291565b428 (diff) |
[Warwickshire]. PopulateServiceList deletion tweak
as WCC is (during beta) mixed email (manually updated) and Open311,
override the behaviour to delete contacts not returned by service list,
to ignore ones that look like email addresses.
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/Open311/PopulateServiceList.pm | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm index a838d0fdd..c47ab143d 100644 --- a/perllib/Open311/PopulateServiceList.pm +++ b/perllib/Open311/PopulateServiceList.pm @@ -44,9 +44,10 @@ sub process_body { my $id = $self->_current_body->id; my $mapit_url = mySociety::Config::get('MAPIT_URL'); my $areas = join( ",", keys %{$self->_current_body->areas} ); - warn "Body $id for areas $areas - $mapit_url/areas/$areas.html - did not return a service list\n" - if $self->verbose >= 1; - warn $open311->error; + if ($self->verbose >= 1) { + warn "Body $id for areas $areas - $mapit_url/areas/$areas.html - did not return a service list\n"; + warn $open311->error; + } return; } $self->process_services( $list ); @@ -248,7 +249,7 @@ sub _add_meta_to_contact { public_anonymity_required email_alerts_requested ) ], - #2242, + #2243, 'Warwickshire County Council' => [qw( external_id easting @@ -296,6 +297,16 @@ sub _delete_contacts_not_in_service_list { } ); + # for Warwickshire, which is mixed Open311 and email, don't delete the email + # addresses + if ($self->_current_body->name eq 'Warwickshire County Council') { + $found_contacts = $found_contacts->search( + { + email => { -not_like => '%@%' } + } + ); + } + $found_contacts->update( { deleted => 1, |