diff options
author | Dave Arter <davea@mysociety.org> | 2020-01-24 17:13:28 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2020-01-24 17:13:28 +0000 |
commit | e009888385867fb2f1aa3f469471dd5f8f07509b (patch) | |
tree | 74bca0f087a76ffb91416da6e23cab8169e41a4b | |
parent | 75c22aec72a0b7d767ef9eb18f9c8fbd1b0d29f2 (diff) |
[Open311] Don’t use full path to open311-populate-service-list in editor column
-rw-r--r-- | perllib/Open311/PopulateServiceList.pm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm index 3e987b7dd..09bd6cd63 100644 --- a/perllib/Open311/PopulateServiceList.pm +++ b/perllib/Open311/PopulateServiceList.pm @@ -1,6 +1,7 @@ package Open311::PopulateServiceList; use Moo; +use File::Basename; use Open311; has bodies => ( is => 'ro' ); @@ -142,7 +143,7 @@ sub _handle_existing_contact { category => $service_name, email => $self->_current_service->{service_code}, state => 'confirmed', - editor => $0, + editor => basename($0), whenedited => \'current_timestamp', note => 'automatically undeleted by script', } @@ -188,7 +189,7 @@ sub _create_contact { body_id => $self->_current_body->id, category => $service_name, state => 'confirmed', - editor => $0, + editor => basename($0), whenedited => \'current_timestamp', note => 'created automatically by script', } @@ -293,14 +294,14 @@ sub _set_contact_group { if (@$new_group) { $contact->set_extra_metadata(group => @$new_group == 1 ? $new_group->[0] : $new_group); $contact->update({ - editor => $0, + editor => basename($0), whenedited => \'current_timestamp', note => 'group updated automatically by script', }); } else { $contact->unset_extra_metadata('group'); $contact->update({ - editor => $0, + editor => basename($0), whenedited => \'current_timestamp', note => 'group removed automatically by script', }); @@ -317,7 +318,7 @@ sub _set_contact_non_public { my %keywords = map { $_ => 1 } split /,/, ( $self->_current_service->{keywords} || '' ); $contact->update({ non_public => 1, - editor => $0, + editor => basename($0), whenedited => \'current_timestamp', note => 'marked private automatically by script', }) if $keywords{private}; @@ -364,7 +365,7 @@ sub _delete_contacts_not_in_service_list { $found_contacts->update( { state => 'deleted', - editor => $0, + editor => basename($0), whenedited => \'current_timestamp', note => 'automatically marked as deleted by script' } |