diff --git a/lib/admin_user_index_query.rb b/lib/admin_user_index_query.rb index eb36e4a25d4..2cd23d0b1c5 100644 --- a/lib/admin_user_index_query.rb +++ b/lib/admin_user_index_query.rb @@ -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, '') != ''") diff --git a/spec/components/admin_user_index_query_spec.rb b/spec/components/admin_user_index_query_spec.rb index f885350202f..c124cc46628 100644 --- a/spec/components/admin_user_index_query_spec.rb +++ b/spec/components/admin_user_index_query_spec.rb @@ -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])