mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Admin group search was failing
This commit is contained in:
parent
629bfb73f5
commit
b175abbfb5
1 changed files with 19 additions and 15 deletions
|
@ -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 a new issue