Skip to content

Commit

Permalink
Do not list local instance actor in account moderation list
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Dec 15, 2020
1 parent 1142418 commit 089368c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/models/account.rb
Expand Up @@ -100,6 +100,7 @@ class Account < ApplicationRecord
scope :sensitized, -> { where.not(sensitized_at: nil) }
scope :without_suspended, -> { where(suspended_at: nil) }
scope :without_silenced, -> { where(silenced_at: nil) }
scope :without_instance_actor, -> { where.not(id: -99) }
scope :recent, -> { reorder(id: :desc) }
scope :bots, -> { where(actor_type: %w(Application Service)) }
scope :groups, -> { where(actor_type: 'Group') }
Expand Down
2 changes: 1 addition & 1 deletion app/models/account_filter.rb
Expand Up @@ -45,7 +45,7 @@ def set_defaults!
def scope_for(key, value)
case key.to_s
when 'local'
Account.local
Account.local.without_instance_actor
when 'remote'
Account.remote
when 'by_domain'
Expand Down
2 changes: 1 addition & 1 deletion spec/models/account_filter_spec.rb
Expand Up @@ -5,7 +5,7 @@
it 'defaults to recent local not-suspended account list' do
filter = described_class.new({})

expect(filter.results).to eq Account.local.recent.without_suspended
expect(filter.results).to eq Account.local.without_instance_actor.recent.without_suspended
end
end

Expand Down

0 comments on commit 089368c

Please sign in to comment.