User sync fixes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-10-31 00:40:54 +01:00
parent 9b563cb8bf
commit 76ee8e6f38
2 changed files with 7 additions and 2 deletions

View File

@ -81,6 +81,7 @@ module.exports = Self => {
});
let accountMap = toMap(accounts, e => {
let user = e.user();
if (!user) return;
return {key: user.roleFk, val: user.name};
});
@ -119,6 +120,7 @@ function toMap(array, fn) {
let map = new Map();
for (let item of array) {
let keyVal = fn(item);
if (!keyVal) continue;
let key = keyVal.key;
if (!map.has(key)) map.set(key, []);
map.get(key).push(keyVal.val);

View File

@ -27,8 +27,11 @@ module.exports = Self => {
}
});
for (let account of accounts)
usersToSync.add(account.user().name);
for (let account of accounts) {
let user = account.user();
if (!user) continue;
usersToSync.add(user.name);
}
// LDAP