FIX: Admin group search was failing

This commit is contained in:
Robin Ward
2014-08-18 14:08:21 -04:00
parent 629bfb73f5
commit b175abbfb5

View File

@@ -37,22 +37,26 @@ function organizeResults(r, options) {
groups = [], groups = [],
results = []; results = [];
r.users.every(function(u) { if (r.users) {
if (exclude.indexOf(u.username) === -1) { r.users.every(function(u) {
users.push(u); if (exclude.indexOf(u.username) === -1) {
results.push(u); users.push(u);
} results.push(u);
return results.length <= limit; }
}); return results.length <= limit;
});
}
r.groups.every(function(g) { if (r.groups) {
if (results.length > limit) return false; r.groups.every(function(g) {
if (exclude.indexOf(g.name) === -1) { if (results.length > limit) return false;
groups.push(g); if (exclude.indexOf(g.name) === -1) {
results.push(g); groups.push(g);
} results.push(g);
return true; }
}); return true;
});
}
results.users = users; results.users = users;
results.groups = groups; results.groups = groups;