User sync fixes
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
9b563cb8bf
commit
76ee8e6f38
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue