mirror of
https://github.com/discourse/discourse.git
synced 2025-09-12 21:10:47 +08:00
FIX: purge unactivated users with a message from non-human users
This commit is contained in:
parent
15bb8954de
commit
7550e9ff95
3 changed files with 16 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
module Jobs
|
||||
class PurgeUnactived < Jobs::Scheduled
|
||||
class PurgeUnactivated < Jobs::Scheduled
|
||||
every 1.day
|
||||
|
||||
def execute(args)
|
||||
|
|
|
@ -1222,7 +1222,9 @@ class User < ActiveRecord::Base
|
|||
.where(active: false)
|
||||
.where("created_at < ?", SiteSetting.purge_unactivated_users_grace_period_days.days.ago)
|
||||
.where("NOT admin AND NOT moderator")
|
||||
.where("NOT EXISTS (SELECT 1 FROM topic_allowed_users WHERE user_id = users.id LIMIT 1)")
|
||||
.where("NOT EXISTS
|
||||
(SELECT 1 FROM topic_allowed_users tu JOIN topics t ON t.id = tu.topic_id AND t.user_id > 0 WHERE tu.user_id = users.id)
|
||||
")
|
||||
.limit(200)
|
||||
.find_each do |user|
|
||||
begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue