Fixed issue with user list (#589)

This commit is contained in:
farhatahmad 2019-06-28 16:06:21 -04:00 committed by Jesus Federico
parent ce2c9c1822
commit 98f7afb9a1
1 changed files with 5 additions and 3 deletions

View File

@ -170,12 +170,14 @@ class AdminsController < ApplicationController
# Gets the list of users based on your configuration
def user_list
list = if @role.present?
User.with_role(@role.to_sym).where.not(id: current_user.id)
else
initial_list = if current_user.has_role? :super_admin
User.where.not(id: current_user.id)
else
User.without_role(:super_admin).where.not(id: current_user.id)
end
list = @role.present? ? initial_list.with_role(@role.to_sym) : initial_list
if Rails.configuration.loadbalanced_configuration
list.where(provider: user_settings_provider)
.admins_search(@search)