agent-authentic2: test if ou is None in provisionning (#35385)

This commit is contained in:
Benjamin Dauvergne 2019-08-13 12:59:14 +02:00
parent 430c184de6
commit 24477e2fd8
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ class Provisionning(threading.local):
# filter user's roles visible by the service's ou
roles = [role for role in user_roles.get(user.id, [])
if (not role.slug.startswith('_')
and (role.ou_id is None or role.ou_id == ou.id))]
and (role.ou_id is None or (ou and role.ou_id == ou.id)))]
data.update({
'uuid': user.uuid,
'username': user.username,