FIX: Do not include non-human users on suspected users list.
https://meta.discourse.org/t/discobot-is-a-suspect-user/70558
This commit is contained in:
parent
6f5051861c
commit
c25730935e
|
@ -81,6 +81,7 @@ class AdminUserIndexQuery
|
|||
where_conds << "user_stats.posts_read_count <= 1 AND user_stats.topics_entered <= 1"
|
||||
|
||||
@query.activated
|
||||
.human_users
|
||||
.references(:user_stats)
|
||||
.includes(:user_profile)
|
||||
.where("COALESCE(user_profiles.bio_raw, '') != ''")
|
||||
|
|
|
@ -90,8 +90,10 @@ describe AdminUserIndexQuery do
|
|||
|
||||
describe 'with a suspected user' do
|
||||
let(:user) { Fabricate(:active_user, created_at: 1.day.ago) }
|
||||
let(:bot) { Fabricate(:active_user, id: -10, created_at: 1.day.ago) }
|
||||
|
||||
it 'finds the suspected user' do
|
||||
bot
|
||||
user
|
||||
query = AdminUserIndexQuery.new(query: 'suspect')
|
||||
expect(query.find_users).to eq([user])
|
||||
|
|
Loading…
Reference in New Issue