FIX: Add email to admin user list when show_emails is enabled (#16636)
Fixes a regression on be519d2
where this case wasn't accounted for.
Reported at https://meta.discourse.org/t/-/226094
This commit is contained in:
parent
2381f18eba
commit
63f239d0b2
|
@ -69,6 +69,8 @@ class AdminUserIndexQuery
|
|||
query = query.includes(:user_stat)
|
||||
end
|
||||
|
||||
query = query.joins(:primary_email) if params[:show_emails] == "true"
|
||||
|
||||
query
|
||||
end
|
||||
|
||||
|
|
|
@ -39,6 +39,11 @@ RSpec.describe Admin::UsersController do
|
|||
end.to change { UserHistory.where(action: UserHistory.actions[:check_email], acting_user_id: admin.id).count }.by(1)
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
|
||||
it "can be ordered by emails" do
|
||||
get "/admin/users/list.json", params: { show_emails: "true", order: "email" }
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue