UX: Do not display non-human users on group page.
https://meta.discourse.org/t/members-of-groups-staff/71437
This commit is contained in:
parent
a88f910469
commit
3efde2618d
|
@ -125,15 +125,17 @@ class GroupsController < ApplicationController
|
|||
order = "#{params[:order]} #{dir} NULLS LAST"
|
||||
end
|
||||
|
||||
total = group.users.count
|
||||
members = group.users
|
||||
users = group.users.human_users
|
||||
|
||||
total = users.count
|
||||
members = users
|
||||
.order('NOT group_users.owner')
|
||||
.order(order)
|
||||
.order(username_lower: dir)
|
||||
.limit(limit)
|
||||
.offset(offset)
|
||||
|
||||
owners = group.users
|
||||
owners = users
|
||||
.order(order)
|
||||
.order(username_lower: dir)
|
||||
.where('group_users.owner')
|
||||
|
|
|
@ -183,7 +183,9 @@ describe GroupsController do
|
|||
)
|
||||
end
|
||||
|
||||
let(:group) { Fabricate(:group, users: [user1, user2, user3]) }
|
||||
let(:bot) { Fabricate(:user, id: -999) }
|
||||
|
||||
let(:group) { Fabricate(:group, users: [user1, user2, user3, bot]) }
|
||||
|
||||
it "should allow members to be sorted by" do
|
||||
get "/groups/#{group.name}/members.json", params: {
|
||||
|
|
Loading…
Reference in New Issue