dont't fail on missing LDAP users
This commit is contained in:
parent
f5343ebd08
commit
bb0cc73318
1 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
"""An API to retrieve and set data in the Warsaw Hackerspce LDAP tree."""
|
||||
|
||||
import ldap
|
||||
import logging
|
||||
|
||||
from flask import g
|
||||
|
||||
|
@ -77,6 +78,9 @@ def update_member_groups(c, changes):
|
|||
for op in changes[group]:
|
||||
for username in changes[group][op]:
|
||||
if op == 'add':
|
||||
if get_member_fields(c, username, ['uid'])['uid'] is None:
|
||||
logging.warning('User %r missing from LDAP, ignoring...', username)
|
||||
continue
|
||||
changed = True
|
||||
target_members.add(username)
|
||||
elif op == 'remove':
|
||||
|
|
Loading…
Reference in a new issue