mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 13:56:50 +08:00
FIX: Admin group search was failing
This commit is contained in:
parent
629bfb73f5
commit
b175abbfb5
|
@ -37,22 +37,26 @@ function organizeResults(r, options) {
|
|||
groups = [],
|
||||
results = [];
|
||||
|
||||
r.users.every(function(u) {
|
||||
if (exclude.indexOf(u.username) === -1) {
|
||||
users.push(u);
|
||||
results.push(u);
|
||||
}
|
||||
return results.length <= limit;
|
||||
});
|
||||
if (r.users) {
|
||||
r.users.every(function(u) {
|
||||
if (exclude.indexOf(u.username) === -1) {
|
||||
users.push(u);
|
||||
results.push(u);
|
||||
}
|
||||
return results.length <= limit;
|
||||
});
|
||||
}
|
||||
|
||||
r.groups.every(function(g) {
|
||||
if (results.length > limit) return false;
|
||||
if (exclude.indexOf(g.name) === -1) {
|
||||
groups.push(g);
|
||||
results.push(g);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (r.groups) {
|
||||
r.groups.every(function(g) {
|
||||
if (results.length > limit) return false;
|
||||
if (exclude.indexOf(g.name) === -1) {
|
||||
groups.push(g);
|
||||
results.push(g);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
results.users = users;
|
||||
results.groups = groups;
|
||||
|
|
Loading…
Reference in New Issue
Block a user