From b4cfb70741096e2f4fb1ec966823529566218cf6 Mon Sep 17 00:00:00 2001 From: quentinchampenois <26109239+Quentinchampenois@users.noreply.github.com> Date: Fri, 24 Nov 2023 15:34:05 +0100 Subject: [PATCH] backport: Unscope users in clean inactive users job #39 --- app/jobs/decidim/cleaner/clean_inactive_users_job.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jobs/decidim/cleaner/clean_inactive_users_job.rb b/app/jobs/decidim/cleaner/clean_inactive_users_job.rb index 1ad62fe..4c4135e 100644 --- a/app/jobs/decidim/cleaner/clean_inactive_users_job.rb +++ b/app/jobs/decidim/cleaner/clean_inactive_users_job.rb @@ -9,11 +9,11 @@ def perform Decidim::Organization.find_each do |organization| next unless organization.delete_inactive_users? - send_warning(Decidim::User.where(organization: organization) + send_warning(Decidim::User.unscoped.where(organization: organization) .not_deleted .where.not(email: "") .where("current_sign_in_at < ?", email_inactive_before_date(organization))) - delete_user_and_send_email(Decidim::User.where(organization: organization) + delete_user_and_send_email(Decidim::User.unscoped.where(organization: organization) .not_deleted .where.not(email: "") .where("warning_date < ?", delete_inactive_before_date(organization)))