Commit a26e9352 authored by Sheldon Led's avatar Sheldon Led

Change `pending_user_count` to rely only on user blocked count

parent a9fecf61
...@@ -477,8 +477,6 @@ module ApplicationSettingsHelper ...@@ -477,8 +477,6 @@ module ApplicationSettingsHelper
end end
def pending_user_count def pending_user_count
return 0 if Gitlab::CurrentSettings.new_user_signups_cap.blank?
User.blocked_pending_approval.count User.blocked_pending_approval.count
end end
end end
......
...@@ -271,18 +271,6 @@ RSpec.describe ApplicationSettingsHelper do ...@@ -271,18 +271,6 @@ RSpec.describe ApplicationSettingsHelper do
expect(pending_user_count).to eq 1 expect(pending_user_count).to eq 1
end end
end end
context 'when the new_user_signups_cap is not present' do
let(:user_cap) { nil }
it { is_expected.to eq 0 }
it 'does not query users unnecessarily' do
expect(User).not_to receive(:blocked_pending_approval)
pending_user_count
end
end
end end
describe '#sidekiq_job_limiter_modes_for_select' do describe '#sidekiq_job_limiter_modes_for_select' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment