diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-06-09 17:02:07 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-06-09 17:02:07 +0100 |
commit | ef777353e5dda764874b713ff131d36868e94371 (patch) | |
tree | 311fdef6d2e52bdf89b2560706daa54e1c838bbc /perllib/FixMyStreet/Script/Inactive.pm | |
parent | abc63a85b47bbc6b9e81c8256a226864ac7fe0ce (diff) | |
parent | e210a3576aa4fe247feafe4f7c0d27e308faba86 (diff) |
Merge branch 'alert-active-deletion'
Diffstat (limited to 'perllib/FixMyStreet/Script/Inactive.pm')
-rw-r--r-- | perllib/FixMyStreet/Script/Inactive.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Script/Inactive.pm b/perllib/FixMyStreet/Script/Inactive.pm index 8dd524ce1..4d28057d4 100644 --- a/perllib/FixMyStreet/Script/Inactive.pm +++ b/perllib/FixMyStreet/Script/Inactive.pm @@ -158,8 +158,14 @@ sub delete_reports { sub anonymize_users { my $self = shift; + my $body_users = FixMyStreet::DB->resultset("Body")->search({ + comment_user_id => { '!=' => undef }, + }, { + columns => 'comment_user_id', + }); my $users = FixMyStreet::DB->resultset("User")->search({ last_active => { '<', interval($self->anonymize) }, + id => { -not_in => $body_users->as_query }, email => { -not_like => 'removed-%@' . FixMyStreet->config('EMAIL_DOMAIN') }, }); |