misc: fix check of manager's roles ou (#48372)
This commit is contained in:
parent
e7a6477635
commit
c0c98c2da5
|
@ -236,9 +236,11 @@ class Command(BaseCommand):
|
|||
with fake_atomic() as fake_state:
|
||||
admin_role = role.get_admin_role()
|
||||
ok = set(manager_roles) <= set([admin_role])
|
||||
if ok:
|
||||
if admin_role.ou != role.ou:
|
||||
self.warning('- "%s" wrong ou, should be "%s" and is "%s"', admin_role, role.ou, admin_role.ou)
|
||||
if ok and manager_roles:
|
||||
if list(manager_roles)[0].ou != role.ou:
|
||||
self.warning(
|
||||
'- "%s" detected wrong ou, should be "%s" and is "%s"',
|
||||
admin_role, role.ou, admin_role.ou)
|
||||
to_change_ou.append((admin_role, role.ou))
|
||||
continue
|
||||
add_members = set()
|
||||
|
|
Loading…
Reference in New Issue