aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Hackney.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2020-06-08 13:05:40 +0100
committerDave Arter <davea@mysociety.org>2020-07-02 14:38:29 +0100
commitaa9d3cce479c7b28ba3f5f09cac0231111aeebf8 (patch)
tree7472471684dac236190b4793b6bdf0ef22b3797e /perllib/FixMyStreet/Cobrand/Hackney.pm
parente8627c718732b2cb325530daf7a5b82998e61512 (diff)
[Hackney] Extend open311_protect flag to entire contact, not just name/group
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/Hackney.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm
index 76cd3f1dd..f08cd0dd9 100644
--- a/perllib/FixMyStreet/Cobrand/Hackney.pm
+++ b/perllib/FixMyStreet/Cobrand/Hackney.pm
@@ -63,4 +63,21 @@ sub anonymous_account {
};
}
+sub open311_skip_existing_contact {
+ my ($self, $contact) = @_;
+
+ # For Hackney we want the 'protected' flag to prevent any changes to this
+ # contact at all.
+ return $contact->get_extra_metadata("open311_protect") ? 1 : 0;
+}
+
+sub open311_filter_contacts_for_deletion {
+ my ($self, $contacts) = @_;
+
+ # Don't delete open311 protected contacts when importing
+ return $contacts->search({
+ extra => { -not_like => '%T15:open311_protect,I1:1%' },
+ });
+}
+
1;